Skip to content

Commit

Permalink
Tweak to eddb.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Feb 15, 2015
1 parent 7d97e17 commit 684ef07
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions misc/eddb.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
import time
import transfers

BASE_URL = "http://eddb.io/archive/v2/"
SYSTEMS_JSON = BASE_URL + "systems.json"
STATIONS_JSON = BASE_URL + "stations.json"
STATIONS_LITE_JSON = BASE_URL + "stations_lite.json"


class JsonQuery(object):
"""
Crappy wrapper around a json query.
Expand Down Expand Up @@ -76,10 +82,7 @@ def fetch_data(self):
def fetch_systems(outFile=None):
""" Load the Systems json data. Returns dict(id: name) """

query = JsonQuery(
url='http://eddb.io/archive/v2/systems.json',
outFile=outFile,
)
query = JsonQuery(url=SYSTEMS_JSON, outFile=outFile)
mask = "'{}',{},{},{},'EDDB','"+query.timestamp+"'"

print(
Expand All @@ -106,13 +109,11 @@ def fetch_systems(outFile=None):

return systems


def fetch_stations(systems, outFile=None):
""" Fetch Stations json - requires a dict(id: name) of systems. """

query = JsonQuery(
'http://eddb.io/archive/v2/stations_lite.json',
outFile=outFile,
)
query = JsonQuery(STATIONS_LITE_JSON, outFile=outFile)
mask = "'{}','{}',{},'{}','{}'"

# EDDB black market is null (unknown), 0 (No) or 1 (Yes)
Expand Down

0 comments on commit 684ef07

Please sign in to comment.