Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2013 03:38
Show Gist options
  • Save anonymous/7425079 to your computer and use it in GitHub Desktop.
Save anonymous/7425079 to your computer and use it in GitHub Desktop.
import json
import urllib
import time
import sys
try:
while True:
t=json.loads("\n".join(urllib.urlopen("https://api.bitcoinaverage.com/no-mtgox/ticker/USD").readlines()))["last"]
f=open(sys.argv[1],'w')
f.write(str(t))
f.close()
time.sleep(30)
except KeyboardInterrupt:
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment