Skip to content

Instantly share code, notes, and snippets.

View markwalkom's full-sized avatar

Mark Walkom markwalkom

View GitHub Profile
@xeraa
xeraa / issues.sh
Last active May 16, 2017 12:46
Export GitHub issues to Elasticsearch
#!/bin/bash
response=200
i=1
while [[ response -eq 200 ]]
do
curl -u '<username>:<token>' "https://api.github.com/repos/<account>/<repository>/issues?filter=all&state=all&per_page=100&page=${i}" > issues${i}.json
response=$(curl --write-out %{http_code} --silent --output /dev/null -u '<username>:<token>' "https://api.github.com/repos/<account>/<repository>/issues/$((i*100))")
((i++))
done