Last active
December 30, 2015 05:19
-
-
Save raws/7782024 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
access_token='...' | |
repo='...' | |
timestamp="$(date "+%s")" | |
github_api_request() { | |
local endpoint="https://api.github.com$1" | |
local file_name="$2" | |
curl -s \ | |
-H "Authorization: token $access_token" \ | |
-H 'Accept: application/vnd.github.beta+json' \ | |
"$endpoint" \ | |
| gzip -9 > "$(output_path "$file_name")" | |
} | |
output_path() { | |
local name="$1" | |
echo "$timestamp-$name.json.gz" | |
} | |
github_api_request "/repos/$repo/issues?state=open" open-issues |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment