Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No buses #2

Open
DimitriPapadopoulos opened this issue Jun 23, 2023 · 1 comment
Open

No buses #2

DimitriPapadopoulos opened this issue Jun 23, 2023 · 1 comment

Comments

@DimitriPapadopoulos
Copy link

DimitriPapadopoulos commented Jun 23, 2023

It doesn't show any buses on my Ubuntu 22.04 workstation:

$ pip install next-bus-bot
Defaulting to user installation because normal site-packages is not writeable
Collecting next-bus-bot
  Using cached next_bus_bot-1.3.2-py3-none-any.whl (11 kB)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from next-bus-bot) (2.25.1)
Requirement already satisfied: tomli in /usr/lib/python3/dist-packages (from next-bus-bot) (1.2.2)
Installing collected packages: next-bus-bot
Successfully installed next-bus-bot-1.3.2
$ 
$ nbb
Next buses at Mare du Vivier (15:49)

$ 
@paquiteau
Copy link
Owner

Hello Dimitri, Thanks for using NBB !

Indeed after filtering there are no buses (by default only the future buses leaving Mare du Vivier towards Gare du Guichet are displayed). This is due to the API returning partial results. Either the API called is (1) not up to date/ incomplete or (2) there is some caching on the IDFM side. I actually don't know how to discriminate between those two possibilities.

An another solution would be to called an another API, that I found by reverse engineering the QR code at the bus stop. An example: https://api-iv.iledefrance-mobilites.fr/lines/v2/line:IDFM:C01561/stops/stop_area:IDFM:420704/realTime

The only problem of this API is that it only gives the buses for a single line. So to get all the buses incoming, it would requires to have the list of all the lines passing at each stop (This data is available of course as a whole (roughly 60MB in CSV), but I would rather choose to request this (there is an APi for that also) only for stop of interests (e.g. the one defined in the config file). I guess this week-end project will need another one ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants