Skip to content

Instantly share code, notes, and snippets.

@Celeo
Last active December 20, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Celeo/6127556 to your computer and use it in GitHub Desktop.
Save Celeo/6127556 to your computer and use it in GitHub Desktop.
Uses the evelink library to show what information is visible for a character given an api key, code, and the character's name.
import evelink, urllib2, sys
from colorama import init, Fore
print 'Setting up console output ...'
init(autoreset = True)
r = Fore.RED
g = Fore.GREEN
w = Fore.WHITE
b = Fore.CYAN
print w + 'Reading settings ...'
api_id = None
api_vCode = None
charname = None
for a in sys.argv:
if a.startswith('id:'):
api_id = int(a.split(':')[1])
elif a.lower().startswith('vcode:'):
api_vCode = str(a.split(':')[1])
elif a.lower().startswith('charname:'):
charname = a.split(':')[1].replace('_', ' ')
if api_id is None or api_vCode is None or charname is None:
sys.exit(r + 'FATAL ERROR: Program needs parameters id:INT vcode:STRING charname:STRING')
print w + 'Setting up environment ...'
eve = evelink.eve.EVE()
defaultapi = evelink.api.API()
charapi = evelink.api.API(api_key=(api_id, api_vCode))
charid = eve.character_id_from_name(charname)
char = evelink.char.Char(api=charapi, char_id=charid)
account = evelink.account.Account(api=charapi)
print w + 'Fetching information from api ...\n'
# Acess mask
print w + 'Access mask for api is ' + g + str(account.key_info()['access_mask'])
# Full character sheet - char/CharacterSheet
try:
char.character_sheet()
except urllib2.HTTPError, e:
print r + 'Cannot fetch character sheet for that character, attempting partial ...'
# Partial character sheet - eve/CharacterInfo
try:
result = charapi.get('eve/CharacterInfo', {'IDs': [charid]})
except urllib2.HTTPError, e:
print r + '\tCannot fetch partial data'
# Contract bids
try:
char.contract_bids()
print g + 'Contract bid data available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch contract bids'
# Contract items
try:
char.contract_bids()
print g + 'Contract item data available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch contract items'
# Contacts
try:
char.contacts()
print g + 'Contact information available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch contact information'
# Wallet balance
try:
char.wallet_balance()
except urllib2.HTTPError, e:
print r + 'Cannot fetch character wallet balance'
# Wallet Journal
try:
char.wallet_transactions()
print g + 'Wallet transactions available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch wallet transactions'
# Wallet Transactions
try:
char.wallet_journal()
print g + 'Wallet journal available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch wallet journal'
# Mail headers
try:
char.messages()
print w + 'Mail headers:'
for m in char.messages():
print g + m
except urllib2.HTTPError, e:
print r + 'Cannot fetch mail headers'
# Standings
try:
char.standings()
print g + 'Standings available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch standings'
# Standings
try:
char.contracts()
print g + 'Contract information available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch contracts'
# Kills
# TODO: Unknown error here
# try:
# char.kills()
# print g + 'Kill data available'
# except urllib2.HTTPError, e:
# print r + 'Cannot fetch kills'
# Notifications
try:
char.notifications()
print g + 'Notifications available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch notifications'
# Market
try:
char.orders()
print g + 'Market activity available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch market data'
# Research
try:
char.research()
print g + 'Research activity available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch research data'
# Medals
try:
char.medals()
print g + 'Medals available'
except urllib2.HTTPError, e:
print r + 'Cannot fetch medals'
print b + 'Done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment