diff --git a/gwr_feed.py b/gwr_feed.py index 91e8084..83cc2b9 100644 --- a/gwr_feed.py +++ b/gwr_feed.py @@ -118,7 +118,6 @@ def get_request_bodies(query, dates): def get_item_listing(query): - query_url = query.config.url + query.config.journey_uri dates = [ query.timestamp + timedelta(days=(7 * x)) for x in range(query.weeks_ahead + 1) @@ -130,7 +129,7 @@ def get_item_listing(query): for date, body in request_dict.items(): - json_dict = get_response_dict(query_url, query, body) + json_dict = get_response_dict(query.config.journey_url, query, body) if json_dict: journeys = json_dict["data"]["outwardservices"] diff --git a/gwr_feed_data.py b/gwr_feed_data.py index 5eebbf9..a450c47 100644 --- a/gwr_feed_data.py +++ b/gwr_feed_data.py @@ -34,9 +34,9 @@ class FeedConfig: base_url: str = GWR_BASE_URL favicon_url: str = GWR_BASE_URL + FAVICON_URI domain: str = GWR_DOMAIN - locations_uri: str = LOCATIONS_SEARCH_URI - journey_uri: str = JOURNEY_SEARCH_URI - basket_uri: str = BASKET_URI + locations_url: str = GWR_API_URL + LOCATIONS_SEARCH_URI + journey_url: str = GWR_API_URL + JOURNEY_SEARCH_URI + basket_url: str = GWR_API_URL + BASKET_URI currency: str = CURRENCY_CODE headers: dict = field(default_factory=dict) diff --git a/gwr_location.py b/gwr_location.py index 4c8a863..af9731b 100644 --- a/gwr_location.py +++ b/gwr_location.py @@ -1,8 +1,6 @@ def get_station_id(station_code, config): - base_url = config.url + config.locations_uri - - search_url = base_url + search_url = config.locations_url config.logger.debug(f"Querying endpoint: {search_url}") diff --git a/server.py b/server.py index e26088a..5648cdc 100644 --- a/server.py +++ b/server.py @@ -26,8 +26,7 @@ def get_session_token(): - basket_url = config.url + config.basket_uri - init_response = requests.get(basket_url, timeout=10) + init_response = requests.get(config.basket_url, timeout=10) new_session_token = init_response.headers.get("Session-Token") if new_session_token: config.logger.debug(f"Received new session token: {new_session_token}")