Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Commit f3b14f4

Browse files
author
Adrian Schneider
committed
Added support for getting interruptions and closed lines
1 parent 7120d7f commit f3b14f4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

mvg/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
departure_url_postfix = "?footway=0"
1212
nearby_url = "https://www.mvg.de/fahrinfo/api/location/nearby"
1313
routing_url = "https://www.mvg.de/fahrinfo/api/routing/?"
14+
interruptions_url = "https://www.mvg.de/.rest/betriebsaenderungen\
15+
/api/interruptions"
1416

1517

1618
def _perform_api_request(url):
@@ -257,6 +259,12 @@ def get_departures(station_id):
257259
return departures
258260

259261

262+
def get_interruptions():
263+
url = interruptions_url
264+
interruptions = _perform_api_request(url)
265+
return interruptions
266+
267+
260268
class Station:
261269
"""Gives you a proxy to get the next departures for a particular
262270
station.

0 commit comments

Comments
 (0)