blob: f6e7ee9a59de5f5e350171e4ca8446799b56f7e4 [file] [log] [blame]
import os
import sys
python26OrHigher = (sys.version_info >= (2, 6))
DEBUG = False
try:
import simplejson
except:
print "Error: simplejson is required to run generate.py where you fetch input from places-stats.mozilla.com"
try:
import httplib2
except:
print "Error: httplib2 is required to run generate.py where you fetch input from places-stats.mozilla.com"
def get_web_data():
h = httplib2.Http(os.tmpnam())
resp, content = h.request("https://places-stats.mozilla.com/stats",
"GET",
headers={'accept': 'application/json'})
obj = simplejson.loads(content)
if DEBUG:
print content
return obj