Guest User

Untitled

a guest
May 11th, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. import requests, json
  2. from threading import Thread
  3.  
  4. class Karasik(Thread):
  5.     def __init__(self):
  6.         Thread.__init__(self)
  7.         self.url = 'https://api.cryptopepe.co/'
  8.         self.data = {'method': 'roll', 'token': 'Сюда токен'}
  9.  
  10.     def run(self):
  11.         while True:
  12.             try:
  13.                 r = requests.post(self.url, data = self.data, headers = self.headers)
  14.                 r = json.loads(r.text)['response']['user']
  15.                 lastRoll = r['lastRollId']
  16.                 message = r['message']
  17.                 dubs = r['dubs']
  18.                 trips = r['trips']
  19.                 quads = r['quads']
  20.                 print(f'{message} {lastRoll} Даблов: {dubs} Триплов: {trips} Квадов: {quads}')
  21.             except:
  22.                 print('Ошибочка.')
  23.  
  24. if __name__ == '__main__':
  25.     for i in range(10):
  26.         karas = Karasik()
  27.         karas.start()
Add Comment
Please, Sign In to add comment