1.2.0 • Published 1 year ago

dsbmobile v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

dsbmobile.js

badge badge badge badge badge

A Javascript package for the dsbmobile API

Installation

$ npm install dsbmobile

Example

import Dsbmobile from "dsbmobile";

const dsb = new Dsbmobile("<id>", "<password>");

dsb.getTimetable().then((timetable) => {
    console.log(timetable.entries[0].newSubject);
});
English

Documentation

You can read the docs right here.

Contribute

Feel free to contribute on the Github repository.

Browser issues

The official dsbmobile API doesn't send a CORS header, which is required for Browser requests, due to security reasons.

However, there is a way to bypass it that is not a security tradeoff.

Use https://mydsb.johannespour.de (also on Github) instead.

You can use it like this like this:

new Dsbmobile({
    id: "<id>",
    password: "<password>",
    baseURL: "https://mydsb.johannespour.de",
    resourceBaseURL: "https://mydsb.johannespour.de/light",
});

After that, all requests will not be sent to the official Server, but to the mydsb.johannespour.de one, which will make a request for you to the resource and add a CORS header.

If you are concerned about privacy and other things, you can check out the code, because it's open source.

Incompatible plan

As I only know the layout of my local DSBmobile substitution plan, it is possible that your DSBmobile substitution plan may be incompatible with this package.

If this is the case, please leave a comment below issue #43, in which you describe the layout of your plan, so a solution can be worked out.

1.2.0

1 year ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago