1.3.1 • Published 8 years ago
sanntid v1.3.1
Sanntid.js
Sanntid.js is a node.js module for getting real-time data from the public Ruter API.
Installation
Simply do
npm install sanntidUse the -g option to make the command globally available as sanntid.
How to work it
As a CLI
./sanntid.js <locationID>Or you can search for a location:
./sanntid.js sofienbergThe result would be something like this:
🚋 17 Rikshospitalet - in 2 minutes
🚌 31 Snarøya - in 2 minutesA list of locations and their IDs can be downloaded from Ruter lab's pages.
You can limit the results to a specific direction by specifying 1 or 2 as the second parameter:
./sanntid.js sofienberg 1As a node module
var sanntid = require('./sanntid'),
allLocations = sanntid.list(),
locations = sanntid.search('sofienberg');
for (var i = 0; i < locations.length; i++) {
sanntid.getRealtimeData(locations[i], '1', function (data) {
console.log(data);
});
}Testing
Run the tests using the npm test command:
npm testLicense
The MIT License
Copyright © 2015 - Mathias Novas
1.3.1
8 years ago
1.3.0
9 years ago
1.2.0
9 years ago
1.1.2
10 years ago
1.1.1
10 years ago
1.1.0
11 years ago
1.0.11
11 years ago
1.0.10
11 years ago
1.0.9
11 years ago
1.0.8
11 years ago
1.0.7
11 years ago
1.0.6
11 years ago
1.0.5
11 years ago
1.0.4
11 years ago
1.0.3
11 years ago
1.0.2
11 years ago
1.0.1
11 years ago
1.0.0
11 years ago