Skip to content

Instantly share code, notes, and snippets.

@d0d0
Created March 10, 2021 09:25
Show Gist options
  • Save d0d0/e8a0a7c1f45b0d695cff5c5ab4543973 to your computer and use it in GitHub Desktop.
Save d0d0/e8a0a7c1f45b0d695cff5c5ab4543973 to your computer and use it in GitHub Desktop.
import time
import traceback
import requests
while True:
try:
with open('token', 'r') as f:
token = f.read().strip()
print(token)
data = {}
data['data']['rsp'] = token
x = requests.post('https://www.old.korona.gov.sk/save_form.php', json=data)
resp = x.json()
print(resp)
if ('errors' in resp and not resp['errors']) and ('warnings' in resp and not resp['warnings']):
break
time.sleep(3)
except:
print(traceback.format_exc())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment