Guest User

Reproduce empty response issue from Torn API

a guest
Jan 17th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. import requests
  2. import time
  3.  
  4. API_KEY = '<MY_API_KEY>'
  5. total = 0
  6. empty = 0
  7.  
  8. while True:
  9. rsp = requests.get(f'https://api.torn.com/user/?selections=log&to=1673884800&key={API_KEY}')
  10. if rsp.json()['log'] is None:
  11. empty += 1
  12. total += 1
  13. if total % 1 == 0:
  14. print(f'Total: {total}, Empty: {empty}')
  15. time.sleep(1)
  16.  
Advertisement
Add Comment
Please, Sign In to add comment