Created
January 10, 2015 17:59
-
-
Save jdavisclark/67df901f71d96b7649b4 to your computer and use it in GitHub Desktop.
simple script to push the latest github repo tag to a geckoboard text widget
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 | |
| ## This script requires jq (http://stedolan.github.io/jq/) and curl | |
| TAGSRESPONSE=`curl --silent -X GET -u YOURKEY:x-oauth-basic https://api.github.com/repos/yourUser/yourRepo/tags` | |
| TAG=`echo $TAGSRESPONSE | /usr/local/bin/jq '.[] | .name' | sort --reverse | head -1 | tr -d '"'` | |
| APIBODY=`echo "{ \"api_key\": \"yourKey\",\"data\": {\"item\": [{\"text\": \"${TAG}\",\"type\": 2}]}}"` | |
| echo $APIBODY > /tmp/apiBody.json | |
| curl --silent -d @/tmp/apiBody.json -X POST -H "Content-Type: application/json" 'https://push.geckoboard.com/v1/send/yourBoardId' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment