@@ -17,6 +17,7 @@ const parseStopover = require('./parse-rest/stopover')
17
17
const parseLocation = require ( './parse-rest/location' )
18
18
const parseArrivalOrDeparture = require ( './parse-rest/arrival-or-departure' )
19
19
const parseTrip = require ( './parse-rest/trip' )
20
+ const formatDate = require ( './format-rest/date' )
20
21
const defaultProfile = require ( './lib/default-profile' )
21
22
const _profile = require ( './p/db' )
22
23
@@ -97,7 +98,8 @@ const profile = {
97
98
parseJourney,
98
99
parseJourneyLeg,
99
100
parseStopover,
100
- parseLocation
101
+ parseLocation,
102
+ formatDate
101
103
}
102
104
103
105
const opt = {
@@ -222,15 +224,63 @@ const trip = async (id) => {
222
224
return parseTrip ( profile , opt , { } ) ( res )
223
225
}
224
226
227
+ // todo: fails with 404
228
+ // const tripHistory = async (tripId) => {
229
+ // const res = await request('rtarchive', {
230
+ // id: tripId,
231
+ // date: profile.formatDate(profile, opt.when || Date.now())
232
+ // })
233
+ // return res
234
+ // }
235
+
236
+ // todo: fails with 404
237
+ // const radar = async (bbox) => {
238
+ // const res = await request('journeyPos', {
239
+ // llLat: bbox.south,
240
+ // llLon: bbox.west,
241
+ // urLat: bbox.north,
242
+ // urLon: bbox.east,
243
+ // // todo: operators, products, attributes, lines, jid, infotexts
244
+ // // todo: maxJny, time
245
+ // date: profile.formatDate(profile, opt.when || Date.now())
246
+ // })
247
+ // return res
248
+ // }
249
+
250
+ // todo: fails with 404
251
+ // const remarks = async () => {
252
+ // const res = await request('himSearch', {
253
+ // // todo: dateB, dateE, timeB, timeE, himIds, operators, categories
254
+ // // todo: channels, companies, metas, himcategory, poly, searchmode
255
+ // // todo: minprio, maxprio
256
+ // })
257
+ // return res
258
+ // }
259
+
260
+ // todo: fails with 404
261
+ // const dataInfo = async () => {
262
+ // const res = await request('datainfo')
263
+ // return res
264
+ // }
265
+
225
266
// journeys()
226
267
// .then(([journey]) => journey.legs.map(l => l.tripId).find(tripId => !!tripId))
227
268
// .then(trip)
269
+ // .then(tripHistory)
228
270
229
271
// locations('leopoldplatz berlin')
230
272
// nearby({type: 'location', latitude: 52.4751309, longitude: 13.3656537})
231
273
// tripAlternatives()
232
274
// departures()
233
275
// arrivals()
276
+ // radar({
277
+ // north: 52.52411,
278
+ // west: 13.41002,
279
+ // south: 52.51942,
280
+ // east: 13.41709
281
+ // })
282
+ // remarks()
283
+ // dataInfo()
234
284
235
285
. then ( data => console . error ( require ( 'util' ) . inspect ( data , { depth : null , colors : true } ) ) )
236
286
. catch ( ( err ) => {
0 commit comments