- json = simplejson.dumps({'name' : 'Jordan'})
- return HttpResponse(json, mimetype='application/json')
\ No newline at end of file
+ # Pass the compressed statistics to the update server
+ post_data = {
+ 'statistics' : binascii.b2a_base64(statistics_compressed),
+ }
+ data = urllib.urlencode(post_data)
+
+ # We simulate some browser, otherwise the server can return 403 response
+ user_agent = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/5'
+ headers={ 'User-Agent' : user_agent,}
+
+ try:
+ check_request = urllib2.Request('%s%s' % (UPDATE_SERVER_URL, '/site_check/'), data, headers=headers)
+ check_response = urllib2.urlopen(check_request)
+ content = check_response.read()
+ except urllib2.HTTPError, error:
+ content = error.read()
+
+ json = simplejson.dumps({})
+ return HttpResponse(content, mimetype='text/html')
\ No newline at end of file