Skip to content

Commit

Permalink
add todos; readme: link to kpublictransport 📝
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Dec 8, 2021
1 parent f6733d9 commit 95d2c61
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const randomizeUserAgent = (userAgent) => {

const md5 = input => createHash('md5').update(input).digest()

// todo [breaking]: remove userAgent parameter
const request = (ctx, userAgent, reqData) => {
const {profile, opt} = ctx

Expand Down
1 change: 1 addition & 0 deletions parse/journey-leg.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const parseJourneyLeg = (ctx, pt, date) => { // pt = raw leg
// todo: pull `public` value from `profile.products`
res.tripId = pt.jny.jid
res.line = pt.jny.line || null
// todo [breaking]: don't call parseStationName() here, add parseDirection() hook
res.direction = pt.jny.dirTxt && profile.parseStationName(ctx, pt.jny.dirTxt) || null

if (pt.jny.pos) {
Expand Down
1 change: 1 addition & 0 deletions parse/location.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ const parseLocation = (ctx, l) => {
}

// We use a "visited list" to prevent endless recursion.
// todo: can we use a WeakMap here?
const seen = Symbol('parseLocation seen items')
const parseLocationWithoutCycles = (ctx, l, ...args) => {
if (ctx[seen] && ctx[seen].includes(l)) return null
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ While `hafas-client` itself should work in the browser via a bundler like [Webpa
- [`BahnhofsAbfahrten`](https://github.com/marudor/BahnhofsAbfahrten) a.k.a. [`marudor.de`](https://marudor.de/) – A very detailed public transport website for Germany. Uses HAFAS underneath, [has an API](https://docs.marudor.de).
- [`public-transport-enabler`](https://github.com/schildbach/public-transport-enabler) – Java equivalent to `hafas-client`, with support for more types of public transport APIs; Used by [Öffi](https://play.google.com/store/apps/details?id=de.schildbach.oeffi) & [Transportr](https://transportr.app).
- [`TripKit`](https://github.com/alexander-albers/tripkit) – Swift equivalent to `hafas-client`, with support for more types of public transport APIs; Used by [ÖPNV Navigator](https://apps.apple.com/de/app/öpnv-navigator/id1239908782).
- [`kpublictransport`](https://github.com/KDE/kpublictransport) – C++ equivalent to `hafas-client`, with support for more types of public transport APIs; Used by [KDE Itinerary](https://apps.kde.org/itinerary/).
- [`pyhafas`](https://github.com/n0emis/pyhafas) – Python equivalent to `hafas-client`, with support for more types of public transport APIs.
- [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format#friendly-public-transport-format-fptf) – A format for APIs, libraries and datasets containing and working with public transport data.
- [`observe-hafas-client`](https://github.com/public-transport/observe-hafas-client) – Observe all departures/arrivals/etc. returned by `hafas-client`.
Expand Down

0 comments on commit 95d2c61

Please sign in to comment.