{"id":18950797,"url":"https://github.com/whywaita/google-drive-checker","last_synced_at":"2026-03-28T14:30:15.862Z","repository":{"id":74409343,"uuid":"184526423","full_name":"whywaita/google-drive-checker","owner":"whywaita","description":":eyes: check files in google drive","archived":false,"fork":false,"pushed_at":"2020-02-16T07:40:14.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-01T02:16:12.103Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whywaita.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-02T05:33:22.000Z","updated_at":"2020-02-16T07:40:17.000Z","dependencies_parsed_at":"2023-06-15T08:00:29.870Z","dependency_job_id":null,"html_url":"https://github.com/whywaita/google-drive-checker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fgoogle-drive-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fgoogle-drive-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fgoogle-drive-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fgoogle-drive-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whywaita","download_url":"https://codeload.github.com/whywaita/google-drive-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239948833,"owners_count":19723364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T13:24:42.199Z","updated_at":"2026-03-28T14:30:15.771Z","avatar_url":"https://github.com/whywaita.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# google-drive-checker\n\nchecker of files in google drive for myself\n\n## check\n\n```\n$ export GD_CHECKER_CRED_JSON='{\"installed\"~~~~}'  # Google API OAuth2 Credential JSON\n$ export GD_CHECKER_PARENT_ID='' # Google Drive Directory ID\n$ export GD_CHECKER_SLACK_HOOK_URL='' # slack incoming-webhook url\n$ export GD_CHECKER_SLACK_CHANNEL_NAME='' # slack notification channel\n$ export GD_CHECKER_GOOGLE_DRIVE_TOKEN='' # Google Drive Refresh Token\n\n$ go test main_test.go\n```\n\n## How to get Google Drive Refresh token\n\n- Auth Code: can get from browser, short expiry\n- Refresh Token: can get from API using Auth Code, never expire until to revoke\n\nyou need to prepare\n- Client ID from service account credential JSON\n- Client Secret from service account credential JSON\n\n\n### get Auth Code (Open in your browser)\nneed to overwrite your project id\n\n```\nhttps://accounts.google.com/o/oauth2/auth?access_type=offline\u0026client_id=\u003c\u003cyour client id\u003e\u003e\u0026redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob\u0026response_type=code\u0026scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive\u0026state=state-token\n```\n\n-\u003e copy auth code\n\n### get refresh token\n\n```\n$ export AUTH_CODE=\n$ export CLIENT_ID=\n$ export CLIENT_SECRET=\n\n$ curl --data \"code=${AUTH_CODE}\" --data \"client_id=${CLIENT_ID}\" --data \"client_secret=${CLIENT_SECRET}\" --data \"redirect_uri=urn:ietf:wg:oauth:2.0:oob\" --data \"grant_type=authorization_code\" --data \"access_type=offline\" https://www.googleapis.com/oauth2/v4/token\n\nresponse example:\n{\n  \"access_token\": \"\",\n  \"expires_in\": 3600,\n  \"refresh_token\": \"\",\n  \"scope\": \"https://www.googleapis.com/auth/drive\",\n  \"token_type\": \"Bearer\"\n}\n```\n\n-\u003e Good!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fgoogle-drive-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhywaita%2Fgoogle-drive-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fgoogle-drive-checker/lists"}