diff --git a/travelInfo.py b/travelInfo.py index eed1eeb..ca967e0 100755 --- a/travelInfo.py +++ b/travelInfo.py @@ -30,8 +30,8 @@ def get_speed_db(): def get_trip_db(): rs = "https://iceportal.de/api1/rs/tripInfo/trip/" - database = "trip.json" - data = json.loads(open(database).read()) + response = get(rs) + data = response.json() next_stop=data["trip"]["stopInfo"]["actualNext"] for i in data['trip']['stops']: @@ -41,7 +41,7 @@ def get_trip_db(): utime=i['timetable']['actualArrivalTime']/1000 arrivalTime = datetime.fromtimestamp(utime, tz=timezonedt).strftime('%H:%M') break - tripinfo = nextStationName + arrivalTime + arrivalDelay + tripinfo = nextStationName+" "+ arrivalTime+" " + arrivalDelay return tripinfo def main():