Skip to content

Instantly share code, notes, and snippets.

@ErikBjare
Last active May 9, 2017 00:11
Show Gist options
  • Save ErikBjare/8332113 to your computer and use it in GitHub Desktop.
Save ErikBjare/8332113 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Requires jq
# Remember to chmod +x!
#
# Add the following cron-job (using "crontab -e") to run at hourly intervals:
# 0 * * * * export DISPLAY=:0.0 && /bin/bash <SCRIPT_PATH_GOES_HERE> > /dev/null 2>&1
# Change <SCRIPT_PATH_GOES_HERE> to the appropriate name
BTCE_PRICE="$(curl -s https://btc-e.com/api/2/btc_usd/ticker | jq '.ticker.last')"
MTGOX_PRICE="$(curl -s http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast | jq '.data.last.display' | cut -d "\"" -f 2)"
notify-send "MtGox: $MTGOX_PRICE
BTC-e: \$$BTCE_PRICE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment