Skip to content
This repository has been archived by the owner on Oct 24, 2019. It is now read-only.
/ db-monitor Public archive

[deprecated] – Fetch departures at DB stations.

License

Notifications You must be signed in to change notification settings

derhuerst/db-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

db-monitor 🔭

Deprecated. Use hafas-monitor-departures with db-hafas.


Fetch departures at DB stations. (You may get blacklisted.)

npm version build status ISC-licensed gitter channel support me on Patreon

Installing

npm install db-monitor

Usage

const monitor = require('db-monitor')

const stations = ['8002553'] // array of station ids
const interval = 10 * 1000 // every 10 seconds

const departures = monitor(stations, interval)
departures.on('error', console.error)
departures.on('data', console.log)

setTimeout(() => {
	departures.stop() // stop querying
}, interval * 3)

The stream will emit Friendly Public Transport Format 1.0.1 departures.

Note: A stream created by calling monitor(…) does not stop calling the API if you unpipe it. You need to manually call departures.stop().

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

About

[deprecated] – Fetch departures at DB stations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published