Created
March 10, 2021 09:25
-
-
Save d0d0/e8a0a7c1f45b0d695cff5c5ab4543973 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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