Skip to content

Instantly share code, notes, and snippets.

Created November 12, 2013 03:35
Show Gist options
  • Save anonymous/862695cafa58a7a1d581 to your computer and use it in GitHub Desktop.
Save anonymous/862695cafa58a7a1d581 to your computer and use it in GitHub Desktop.
import urllib2
import json
import time
filename="data.json"
while(1):
response = urllib2.urlopen("https://api.bitcoinaverage.com/no-mtgox/ticker/USD")
data = json.load(response)
fh = open(filename, "w")
json.dump(data, fh)
fh.close()
time.sleep(30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment