dsb

Creator: coderz1093

Last updated:

0 purchases

dsb Image
dsb Images

Languages

Categories

Add to Cart

Description:

dsb

dsb #

This package allows you to crawl DSB's "Mobile API".
If you want a higher-level API and need to parse Untis, too, consider using
dsbuntis.
Usage #
Sessions are created in two ways: Logging in or using an existing token.
To log in, you call Session.login:
final session = await Session.login('187801', 'public');
copied to clipboard
To use an existing token, the Session constructor allows for passing them:
final session = Session('13ccccbb-e6a8-466a-addc-00bba830c6cf');
copied to clipboard
Then you can, for example, get the timetable information:
final timetables = await session.getTimetables();
copied to clipboard
Caching and best practices #
A very important feature in dsbuntis from the beginning has been good caching.
For documentation on how to set it up for the actual requests, please refer to
the schttp documentation, as it is our HTTP backend. However, you can
aditionally cache the Session objects.
AFAIK the login of
DSBMobile is idempotent (as indicated by it being a GET request) and always
returns the same token. If it is, which you can safely assume by now, you can
cache the Session's token forever. Otherwise you can still keep the
Session object around for a while.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.