Added some more niceness. Updated eve api for pulling ticker from corp

This commit is contained in:
Raynaldo Rivera
2014-10-05 23:29:19 -07:00
parent b748c223c8
commit 7521d9fc4d
8 changed files with 138 additions and 28 deletions

View File

@@ -1,3 +1,4 @@
import sys
import evelink.api
import evelink.char
import evelink.eve
@@ -8,12 +9,30 @@ class EveApiManager():
def __init__(self):
pass
def get_characters_from_api(self, api_id, api_key):
api = evelink.api.API(api_key=(api_id, api_key))
# Should get characters
account = evelink.account.Account(api=api)
chars = account.characters()
chars = []
try:
api = evelink.api.API(api_key=(api_id, api_key))
# Should get characters
account = evelink.account.Account(api=api)
chars = account.characters()
except evelink.api.APIError as error:
print error
return chars
def get_corporation_ticker_from_id(self, corp_id):
ticker = ""
try:
print corp_id
api = evelink.api.API()
corp = evelink.corp.Corp(api)
response = corp.corporation_sheet(corp_id)
print response
ticker = response[0]['ticker']
except evelink.api.APIError as error:
print error
return ticker