Guest User

Untitled

a guest
Feb 23rd, 2020
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. import requests
  2.  
  3. systemlist = []
  4. id = None
  5. system_get = raw_input('Enter system name: ')
  6. r = requests.get('https://esi.evetech.net/latest/search/?categories=solar_system&search='+system_get+'&strict=true')
  7. i = r.json()
  8. for key, value in i.items():
  9. id = str(value[0]).strip()
  10. if id != None:
  11. r = requests.get('https://esi.evetech.net/latest/industry/systems/?datasource=tranquility')
  12. for i in r.json():
  13. systemlist.append(i)
  14. for system in systemlist:
  15. for key, value in system.items():
  16. if str(key) == "solar_system_id" and str(value) == id:
  17. print "\n"+system_get
  18. print "System ID: "+str(value)+"\n"
  19. for key, value in system.items():
  20. if key == "cost_indices":
  21. for v in value:
  22. for key, value in v.items():
  23. if key == "cost_index":
  24. print str(key)+" -> "+str(value)
  25. else:
  26. print str(key)+" -> "+str(value)+"\n"
Add Comment
Please, Sign In to add comment