0.7.4 • Published 1 month ago

dsb-untis v0.7.4

Weekly downloads
13
License
MIT
Repository
github
Last release
1 month ago

version downloads MIT License

DSB crawler and Untis's HTML parser / REST service

Basic Usage

import DsbUntis from 'dsb-untis';

const username = "165931";
const password = "secret";

const dsbUntis = new DsbUntis(username, password);
dsbUntis.fetch().then((data) => {
  console.log(JSON.stringify(data))
});

Server Mode

Start a HTTP server providing the data:

import DsbUntis = from 'dsb-untis';

const username = "165931";
const password = "secret";

const dsbUntis = new DsbUntis(username, password);
dsbUntis.listen(9000);

Server Mode / Docker Image

Supported platforms:

  • linux/amd64
  • linux/arm64
  • linux/arm/v7 (PI 4B)
docker run --rm  -d -e USERNAME="165931" -e PASSWORD="secret" -p 8080:8080  aschuma/dsb-untis:latest

Example Result

[
  {
    "date": "2021-01-15T16:33:00.000Z",
    "dateString": "15.01.2021 17:33",
    "table": [
      [
        "Datum",
        "Tag",
        "Fach",
        "Stunde",
        "Lehrer",
        "Text",
        "Raum",
        "(Fach)",
        "Art",
        "Vertr. von / verlegt"
      ],
      [
        "6b"
      ],
      [
        "15.1.",
        "Fr",
        "E",
        "3 - 4",
        "Kmt",
        "",
        "---",
        "E",
        "Entfall",
        ""
      ],
      [
        "9c"
      ],
      [
        "15.1.",
        "Fr",
        "D",
        "6",
        "Nlr",
        "",
        "R109",
        "D",
        "Vertretung",
        ""
      ]
    ]
  },
  {
    "date": "2021-01-15T16:33:00.000Z",
    "dateString": "15.01.2021 17:33",
    "table": [
      [
        "Datum",
        "Tag",
        "Klasse(n)",
        "Fach",
        "Stunde",
        "Lehrer",
        "Text",
        "Raum",
        "(Fach)",
        "Grund: (Lehrer)",
        "Art",
        "Vertr. von / verlegt"
      ],
      [
        "6b"
      ],
      [
        "18.1.",
        "Mo",
        "6b",
        "Mu",
        "3 - 4",
        "Bo",
        "",
        "MuS",
        "Mu",
        "Kfm",
        "Vertretung",
        ""
      ],
      [
        "7a"
      ],
      [
        "18.1.",
        "Mo",
        "7a",
        "D",
        "1 - 2",
        "Cla",
        "",
        "R008",
        "D",
        "Kfm",
        "Vertretung",
        ""
      ],
      [
        "9a"
      ],
      [
        "18.1.",
        "Mo",
        "9a, 9b, 9c",
        "EvR",
        "3 - 4",
        "Btl",
        "",
        "---",
        "EvR",
        "Btl",
        "Entfall",
        ""
      ],
      [
        "9b"
      ],
      [
        "18.1.",
        "Mo",
        "9a, 9b, 9c",
        "EvR",
        "3 - 4",
        "Bl",
        "",
        "---",
        "EvR",
        "Btl",
        "Entfall",
        ""
      ],
      [
        "9c"
      ],
      [
        "18.1.",
        "Mo",
        "9a, 9b, 9c",
        "EvR",
        "3 - 4",
        "Btl",
        "",
        "---",
        "EvR",
        "Btl",
        "Entfall",
        ""
      ],
      [
        "10a"
      ],
      [
        "18.1.",
        "Mo",
        "10a, 10b, 10c",
        "EvR",
        "1 - 2",
        "Btz",
        "",
        "---",
        "EvR",
        "Btl",
        "Entfall",
        ""
      ],
      [
        "18.1.",
        "Mo",
        "10a",
        "Mu",
        "5",
        "Trä",
        "",
        "MuS",
        "Mu",
        "Kfn",
        "Vertretung",
        ""
      ],
      [
        "10b"
      ],
      [
        "18.1.",
        "Mo",
        "10a, 10b, 10c",
        "EvR",
        "1 - 2",
        "Btl",
        "",
        "---",
        "EvR",
        "Btl",
        "Entfall",
        ""
      ]
    ]
  },
  {
    "date": "2021-01-15T16:33:00.000Z",
    "dateString": "15.01.2021 17:33",
    "table": [
      [
        "Datum",
        "Tag",
        "Klasse(n)",
        "Fach",
        "Stunde",
        "Lehrer",
        "Text",
        "Raum",
        "(Fach)",
        "Grund: (Lehrer)",
        "Art",
        "Vertr. von / verlegt"
      ],
      [
        "10c"
      ],
      [
        "18.1.",
        "Mo",
        "10a, 10b, 10c",
        "EvR",
        "1 - 2",
        "Btl",
        "",
        "---",
        "EvR",
        "Btz",
        "Entfall",
        ""
      ],
      [
        "Jg2"
      ],
      [
        "18.1.",
        "Mo",
        "Jg2",
        "er",
        "8 - 9",
        "Btl",
        "",
        "---",
        "er",
        "Btl",
        "Entfall",
        ""
      ]
    ]
  }
]

Advanced Feature

The returned data can be customized by passing a list of extractors to the fetch method. There are some built-in extractors located in the src/timetableHtmlExtractors folder, however, you can also create your own custom extractors if needed.

0.7.2

1 month ago

0.7.1

1 month ago

0.7.4

1 month ago

0.7.3

1 month ago

0.7.0

1 month ago

0.6.2

1 month ago

0.6.1

1 month ago

0.6.0

1 month ago

0.5.3

1 month ago

0.5.2

1 month ago

0.5.0

1 year ago

0.5.1

1 year ago

0.4.3

2 years ago

0.3.9

3 years ago

0.3.7

3 years ago

0.4.0

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago