Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. import requests
  2. import json
  3. import time
  4. import webbrowser
  5. import ctypes
  6.  
  7.  
  8. APIkey = 'APIKEYHERE'
  9. y = ''
  10. x = ''
  11. userId = ''
  12.  
  13. def userWatch(APIkey,userId):
  14. userInfo = json.loads(requests.get('https://api.torn.com/user/%s?selections=basic&key=%s'%(userId,APIkey)).text)
  15. for value in userInfo['status']:
  16. y = value
  17. if y == 'Okay':
  18. clv = ctypes.windll.user32.MessageBoxW(0, (userInfo['name']+' is '+y), 'ALERT', 0x30 | 0x1000)
  19. if clv == 1:
  20. webbrowser.open_new('https://www.torn.com/profiles.php?XID=%s'%(userId))
  21. print()
  22. userr = input("Choose another target (y/n) ")
  23. if userr == 'y':
  24. userInputs()
  25. else:
  26. input('press "Enter" to quit')
  27. sys.exit
  28.  
  29. def watch(y,x,userId):
  30. while y != 'Okay':
  31. time.sleep(int(x))
  32. userWatch(APIkey,userId)
  33.  
  34. def userInputs():
  35. userId = input('Enter User ID - ')
  36. x = input('Refresh time - ')
  37. watch(y,x,userId)
  38.  
  39. userInputs()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement