mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-06 23:26:19 +01:00
Added some more niceness. Updated eve api for pulling ticker from corp
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user