Guest User

Untitled

a guest
Aug 9th, 2015
198
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MY_TEAM_ID=17
  2.  
  3. import os
  4. os.system('rm rankings.js')
  5. os.system('wget https://davar.icfpcontest.org/rankings.js')
  6. s = open('rankings.js').readline()[len('var data = '):]
  7. d = eval(s)
  8.  
  9. time = d['time']
  10. print(time)
  11.  
  12. maps = d['data']['settings']
  13.  
  14. scores = {}
  15. for m in maps:
  16. setting = m['setting']
  17. for scr in m['rankings']:
  18. if scr['teamId'] == MY_TEAM_ID:
  19. scores[setting] = (scr['rank'],scr['score'],
  20. scr['power_score'],scr['tags'])
  21. break
  22.  
  23. for s in scores:
  24. print(s, scores[s])
RAW Paste Data