Go to the documentation of this file.00001
00002
00003 def db_check(msg):
00004
00005 try:
00006 import requests
00007 except ImportError, e:
00008 print str(e), ", skipping db_check."
00009
00010
00011 return True
00012
00013 url = 'https://docs.google.com/forms/d/1FuvFIWQui1dawi9OtPgEo4Q6V729hkhjfRetJKtId3Q/formResponse'
00014 form_data = {'entry.1561122805':msg}
00015 user_agent = {'Referer':'https://docs.google.com/forms/d/1FuvFIWQui1dawi9OtPgEo4Q6V729hkhjfRetJKtId3Q/viewform','User-Agent': "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.52 Safari/537.36"}
00016
00017 print "\n* Saving DB..\n"
00018 try:
00019 r = requests.post(url, data=form_data, headers=user_agent)
00020
00021 except Exception, e:
00022 print "".join(map(lambda s: hex(s), [ord(s) for s in e.message.message]))
00023 return False
00024 if not r.ok:
00025 print " ... Could not find internet connection"
00026 return r.ok
00027
00028
00029