github-views-botter/main.py

20 lines
378 B
Python
Raw Normal View History

2021-08-29 15:08:23 +00:00
import requests, threading, os
2021-08-29 13:58:32 +00:00
2021-08-29 15:08:23 +00:00
url = os.environ['URL']
2021-08-29 15:12:10 +00:00
amount = os.environ['AMOUNT']
2021-08-29 13:58:32 +00:00
2021-08-29 14:27:06 +00:00
def thread():
2021-09-04 09:53:27 +00:00
while True:
sent = 0
r = requests.get(url)
if r.status_code == 403:
print('Invalid URL')
else:
pass
2021-08-29 14:12:44 +00:00
sent += 1
print(f'Views sent: %s' % sent)
for _ in range(int(amount)):
2021-08-29 14:27:06 +00:00
t = threading.Thread(target=thread)
2021-08-29 14:12:44 +00:00
t.start()