{"id":21202948,"url":"https://github.com/7rikazhexde/gasgetgithubinsights","last_synced_at":"2026-04-17T15:01:41.346Z","repository":{"id":155117409,"uuid":"540480394","full_name":"7rikazhexde/gasGetGitHubInsights","owner":"7rikazhexde","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-10T13:57:13.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T17:04:24.149Z","etag":null,"topics":["github","google-apps-script","google-spreadsheet"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/7rikazhexde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-09-23T14:30:56.000Z","updated_at":"2024-11-10T13:57:17.000Z","dependencies_parsed_at":"2025-03-14T22:41:46.395Z","dependency_job_id":"04d3704d-e8e8-4bea-897f-76fa2af5340c","html_url":"https://github.com/7rikazhexde/gasGetGitHubInsights","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/7rikazhexde/gasGetGitHubInsights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7rikazhexde%2FgasGetGitHubInsights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7rikazhexde%2FgasGetGitHubInsights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7rikazhexde%2FgasGetGitHubInsights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7rikazhexde%2FgasGetGitHubInsights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7rikazhexde","download_url":"https://codeload.github.com/7rikazhexde/gasGetGitHubInsights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7rikazhexde%2FgasGetGitHubInsights/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266161900,"owners_count":23885927,"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":["github","google-apps-script","google-spreadsheet"],"created_at":"2024-11-20T20:19:47.003Z","updated_at":"2026-04-17T15:01:36.257Z","avatar_url":"https://github.com/7rikazhexde.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gasGetGithubInsights\r\nGoogle Apps Script (GAS) to get Traffic Data using Github API\r\n\r\n## Scripts Folder\r\n* getGithubInsightsTrafficViews  \r\n  Get the **views (Traffic / Visitor / views \u0026 unique visitors)** information from GitHub Insights and add it to the spreadsheet you create for each public repository.\r\n* getGithubInsightsTrafficClones  \r\n  Get the **Visitors (Traffic / Git clones / clone \u0026 unique cloners)** information from GitHub Insights and add it to the spreadsheet you create for each public repository.\r\n\r\n## Usage\r\n### Note\r\nIf you encounter scope setting errors, please refer to the comments in the source code and the official documentation.  \r\nDetails: https://developers.google.com/apps-script/reference\r\n\r\n### Github Setting\r\n#### Obtain a GitHub API key and set permissions\r\n* From the account icon in the upper right corner of GitHub, select [Settings] → [Developer settings] → [Personal access token].\r\nClick [Generate new token] to issue a new token.\r\n* In [Select scopes], check only [public_repo] to target Traffic data in public repositories.\r\n* Details: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\r\n\r\n### GAS Setting\r\n#### Create .gs files\r\n* Copy and paste the .gs file from the folder(ex. getGithubInsightsTrafficViews) under the scripts folder to create it.\r\n\r\n#### Set personal access token to GAS\r\n* Define in ```spreadSheetID``` in ```getGithubInsights/config.gs```\r\n\r\n#### Set Github access token and Request URL to GAS\r\n* Define in ```personalAccessToken``` and ```username``` in ```getGithubInsights/config.gs```\r\n\r\n#### Set permissions from script to Google account\r\n* Execute ```main()``` to allow access to your Google account from scripts\r\n  * Browse, edit, create, and delete Google Spreadsheets\r\n  * Connect to external services\r\n  * Allow this application to run when you are not present\r\n* If you are using Japanese language settings, 「シート1」 will be displayed when creating a spreadsheet. This depends on the language setting, but if you do not need it, delete it manually.\r\n* Set project to periodic execution (If periodic execution is enabled.)\r\n  * Set from \"Edit\" -\u003e \"Triggers for current project\". set to retrieve once a day)\r\n\r\n#### [OPTION] Enable ```main()``` function execution from smart phones\r\nIf you want to enable ```main()``` function execution from smartphones, you must register an Event handler (InstallableTriggers) yourself.\r\n\r\n Step1. Enable the following commented out functions below from ```spreadSheet.gs```.  \r\n  * ```createEditTrigger()```\r\n  * ```onEditCell(e)```\r\n  * ```onEdit(e)```\r\n  * ```enableSmartPhoneActionSupport()```\r\n \r\n Step2. Execute ```enableSmartPhoneActionSupport()```  \r\n  * If the function execution is successful, the ```onEditCell(e)``` function is added to the list of added triggers.  \r\n  * If you wish to delete ```onEditCell(e)```, please delete it from the \"Delete Trigger\" menu.\r\n\r\n Step3. Remove or comment out ```function onEdit(e)```  \r\n  * Thereafter, when a user changes a value in a spreadsheet, ```onEditCell(e)``` will be executed.\r\n \r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7rikazhexde%2Fgasgetgithubinsights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7rikazhexde%2Fgasgetgithubinsights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7rikazhexde%2Fgasgetgithubinsights/lists"}