-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpush_rank.py
33 lines (30 loc) · 923 Bytes
/
push_rank.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import threading
import requests
import os
import time, json, datetime
print('-- Tipe Ronde --')
print('1. Ronde 3 (Tereliminasi)')
print('2. Juara 1 (Mahkota)')
ronde = input('Pilih ronde: ')
time.sleep(1)
total_thread = os.cpu_count()
time.sleep(1)
loop = 1
def push_rank():
auth = open("auth.txt", "r")
headers = {
'authorization':auth.read()
}
while loop == 1:
jam = datetime.datetime.now()
if ronde == '1':
juara = 2
else:
juara = 3
req = requests.get('http://kitkabackend.eastus.cloudapp.azure.com:5010/round/finishv2/{}'.format(juara), headers=headers)
response = json.loads(req.text)
print('[{}-{}-{} {}:{}:{}] SUCCESS |TROPI: {} |MAHKOTA: {}'.format(jam.year, jam.month, jam.day, jam.hour, jam.minute, jam.second, response['User']['SkillRating'], response['User']['Crowns']))
time.sleep(0.05)
for i in range(1, total_thread + 1):
t = threading.Thread(target=push_rank)
t.start()