Skip to content

Instantly share code, notes, and snippets.

View C0staTin's full-sized avatar

Costa Tin C0staTin

View GitHub Profile
@chiradeep
chiradeep / Code.gs
Last active April 3, 2022 16:42
Google App Script to Collect GH Traffic Stats into Google Sheets
//Setup:
// Create a sheet with the first sheet called 'TrafficData'. Cell Values are:
// A1: Repo Traffic Collector
// A3: Organization B3: <org value>
// A4: Repo B4: <repo name>
// A7: Date, B7: Views, C7: Uniques, D7: Weeknumber
//Tools -> Script Editor
//Add this script, fill in your GitHub TOKEN (https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line)
//Run the onOpen script - you will be warned it is insecure, but accept anyway. This should add a menu item to your sheet
//Use the Custom GitHub menu to run the getRepoTrafficStats function