Skip to content

v1.2.0

Latest
Compare
Choose a tag to compare
@Tch1b0 Tch1b0 released this 15 Jan 09:00
b4bf0e0

enhanced the customization: In case your timetable isn't compatible with mine(@Tch1b0), you can now define your own htmlHandler like this:

TimeTable.htmlHandler = (html) => {
  let div = html("my-div")
  let data = div.text()

  return new TimeTable(...)
}

and then you can get your timetable as you are used to:

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

// timetable is now parsed using the custom handler
const timetable = await dsb.getTimetable()

To reset to the default handler you can just write:

TimeTable.htmlHandler = undefined