Skip to content

Instantly share code, notes, and snippets.

@Tharre
Created February 7, 2015 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tharre/706b0d8c3567c1f5346a to your computer and use it in GitHub Desktop.
Save Tharre/706b0d8c3567c1f5346a to your computer and use it in GitHub Desktop.
#!/bin/bash -e
# requires: jshon, perl, curl
input="input.json.tmp"
cleanup() {
rm -f $input
}
if [ $# -eq 0 ]; then
echo "Usage: $0 <user/repo>" >&2
exit 1
fi
trap cleanup EXIT
curl "https://api.github.com/repos/$1/issues" > $input
let count=$(jshon -l < $input)-1
for i in $(seq 0 $count);
do
printf "%s (#%d)%n\n" "$(jshon -e "$i" -e title -u < $input)" "$(jshon -e "$i" -e number -u < $input)" n
perl -e "print '='x$n"
printf "\n\n"
jshon -e "$i" -e body -u < $input
printf "LABELS: "
jshon -e "$i" -e labels -a -e name -u < $input | paste -s -d" "
printf "\n\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment