Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib.request
- import sched, time
- s = sched.scheduler(time.time, time.sleep)
- def func():
- while True:
- response = urllib.request.urlopen('https://europe-west2-durable-matter-241821.cloudfunctions.net/get_votes-1')
- html = response.read().decode("utf-8").replace("<pre>","")
- html = html.replace("</pre>","")
- lines = html.splitlines()
- print(lines[1])
- print(lines[2])
- print(lines[len(lines)-1])
- l1 = lines[1].split("%")[0]
- l2 = lines[2].split("%")[0]
- diff = lines[2].split("-")
- diff = diff[len(diff)-1]
- print("Diferenta:",float(l1)-float(l2),"%","[",diff,"]")
- print("\n")
- time.sleep(30)
- func()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement