Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # A counter booster, made strictly for fun
- # and with a generous permission of a website owner
- import requests
- import threading
- import time
- results = []
- def increment() :
- url = 'https://count.altervista.org/increment.php?v=3'
- headers = {
- 'user-agent' : 'my_emo_phase',
- 'Content-Type' : 'application/json',
- 'X-Clicked' : 'true'
- }
- payload = {}
- responce = requests.post(url,json=payload,headers=headers)
- result = responce.json()
- #the following two lines may be deleted if you are not planning to measure the performance
- if result['success'] :
- results.append(True)
- def multi2(num) :
- tasks = [ threading.Thread(target=increment) for _ in range(num) ]
- for t in tasks :
- t.start()
- for t in tasks :
- t.join()
- #try for 1 minutes and count successful attempts
- def measure_results() :
- start_time = time.time()
- current_time = time.time()
- while start_time+60 > current_time :
- multi2(16)
- current_time = time.time()
- print(current_time)
- print(len(results))
- #Just run
- def forever() :
- while True :
- multi2(16)
- #uncomment the following line and delete "forever()" to measure performance
- #measure_results()
- forever()
Advertisement
Add Comment
Please, Sign In to add comment