Hacker News new | ask | show | jobs
by Elzear 1387 days ago
Hi, I know you! You're hard to miss when working on public transportation. Very happy to see you're looking at my project! I sent you an email.

v5.vbb.transport.rest's frames were missing something I needed, if I recall correctly. With a fork of hafas-client, I got something to work okay. I was going to release it too, but then I realised I should use another user agent than 'my-awesome-program' which only VBB can provide, I think.

1 comments

> v5.vbb.transport.rest's frames were missing something I needed, if I recall correctly. With a fork of hafas-client, I got something to work okay.

It would be great if you could create an Issue in hafas-client about this, so everyone can benefit from the changes.

> I realised I should use another user agent than 'my-awesome-program' which only VBB can provide, I think

If you're talking about hafas-client: No, you can use anything! It's merely about being transparent towards VBB who/what is using their API, but they don't have to approve it beforehand; They can't in fact, because the "mobile" HAFAS API just uses a static auth token.

Oh okay. Here is an old version of Ubähnchen with the toggle for "live mode / planned mode" on the top right: https://ubahnchen-inona1te6-lzear.vercel.app/?live The URL parameter still works in the current version by the way.

When I changed 'my-awesome-program' to 'ubahnchen' or something else when creating the hafas-client, it stopped getting valid responses. So I thought I should wait for VBB to give me an ID that works.

> When I changed 'my-awesome-program' to 'ubahnchen' or something else when creating the hafas-client, it stopped getting valid responses.

Please report this as an Issue in the hafas-client repo, so we can discuss this further.

> So I thought I should wait for VBB to give me an ID that works.

This is not how it works: - The official VBB API is an entirely different API, which they give you an auth token for when you ask. - hafas-client uses the "mobile" API, which has a static universal auth token. But it sends a (slightly randomised) User-Agent in order to communicate who/what is making requests. It might be that some User-Agents are blocked.