summaryrefslogtreecommitdiff
path: root/bvggrabber
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2014-10-10 01:01:18 +0200
committerMarkus Holtermann <info@markusholtermann.eu>2014-10-10 01:01:18 +0200
commit52c014264138af5d4f8a7b34fdf431abe689943d (patch)
tree36a690ab60a6c0dfcd8eab8514061c02812796cb /bvggrabber
parente1cb4f1d11c6f9bd7304b608023abc52a33f9026 (diff)
downloadbvg-grabber-52c014264138af5d4f8a7b34fdf431abe689943d.tar.gz
bvg-grabber-52c014264138af5d4f8a7b34fdf431abe689943d.tar.bz2
bvg-grabber-52c014264138af5d4f8a7b34fdf431abe689943d.zip
Fixed #8 -- Added support for limit to ActualDepartureQueryApi
Diffstat (limited to 'bvggrabber')
-rw-r--r--bvggrabber/api/actualdeparture.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py
index 54eb6a7..a1b3b5a 100644
--- a/bvggrabber/api/actualdeparture.py
+++ b/bvggrabber/api/actualdeparture.py
@@ -11,7 +11,7 @@ ACTUAL_API_ENDPOINT = 'http://mobil.bvg.de/Fahrinfo/bin/stboard.bin/dox?ld=0.1&r
class ActualDepartureQueryApi(QueryApi):
- def __init__(self, station):
+ def __init__(self, station, limit=5):
super(ActualDepartureQueryApi, self).__init__()
if isinstance(station, str):
self.station_enc = station.encode('iso-8859-1')
@@ -20,9 +20,14 @@ class ActualDepartureQueryApi(QueryApi):
else:
raise ValueError("Invalid type for station")
self.station = station
+ self.limit = limit
def call(self):
- params = {'input': self.station_enc, 'start': 'suchen'}
+ params = {
+ 'input': self.station_enc,
+ 'maxJourneys': self.limit,
+ 'start': 'suchen',
+ }
response = requests.get(ACTUAL_API_ENDPOINT, params=params)
if response.ok:
soup = BeautifulSoup(response.text)