Created
October 12, 2011 04:12
-
-
Save kylegibson/1280249 to your computer and use it in GitHub Desktop.
Bash script to scrape current bitcoin exchange prices and update a local json file
This file contains 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 | |
BTC_PATH=$1 | |
REMOTE_URL=http://bitcoincharts.com/t/weighted_prices.json | |
wget -q -O $BTC_PATH.temp $REMOTE_URL | |
test $? -ne 0 && exit | |
test ! -e $BTC_PATH.temp && exit | |
test $(stat -c%s $BTC_PATH.temp) -lt 600 && exit | |
mv $BTC_PATH{.temp,} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment