Skip to content

Instantly share code, notes, and snippets.

@jdavisclark
Created January 10, 2015 17:59
Show Gist options
  • Select an option

  • Save jdavisclark/67df901f71d96b7649b4 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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