23 lines
660 B
JavaScript
23 lines
660 B
JavaScript
import {inspect} from 'util'
|
|
import {createClient} from 'hafas-client'
|
|
import {profile as vbnProfile} from 'hafas-client/p/vbn/index.js'
|
|
|
|
// Adapt this to your project! createClient() won't work with this string.
|
|
const userAgent = 'dialog@swingbe.de'
|
|
|
|
// create a client with the VBN profile
|
|
const client = createClient(vbnProfile, userAgent)
|
|
|
|
const bremerhavenHbf = '9014418'
|
|
const verden = '9093627'
|
|
const bremenRutenstr = {
|
|
type: 'location',
|
|
id: '990025693',
|
|
address: 'Bremen Rutenstraße 1',
|
|
latitude: 53.074165, longitude: 8.8184
|
|
}
|
|
|
|
let data = await client.locations('oldenburg', {results: 2})
|
|
|
|
console.log(inspect(data, {depth: null, colors: true}))
|