From 95d2c61fbdfc0d285ed405e377bfe2852ee3c713 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 8 Dec 2021 14:12:22 +0100 Subject: [PATCH] =?UTF-8?q?add=20todos;=20readme:=20link=20to=20kpublictra?= =?UTF-8?q?nsport=20=F0=9F=93=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/request.js | 1 + parse/journey-leg.js | 1 + parse/location.js | 1 + readme.md | 1 + 4 files changed, 4 insertions(+) diff --git a/lib/request.js b/lib/request.js index 868c2555..756cb8fc 100644 --- a/lib/request.js +++ b/lib/request.js @@ -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 diff --git a/parse/journey-leg.js b/parse/journey-leg.js index 92708522..dd2eb5aa 100644 --- a/parse/journey-leg.js +++ b/parse/journey-leg.js @@ -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) { diff --git a/parse/location.js b/parse/location.js index 9c15bb6a..cccf16ff 100644 --- a/parse/location.js +++ b/parse/location.js @@ -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 diff --git a/readme.md b/readme.md index a1dfc144..cdce74b6 100644 --- a/readme.md +++ b/readme.md @@ -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`.