Skip to content

Commit

Permalink
Updated with new examples to test and validate PR
Browse files Browse the repository at this point in the history
  • Loading branch information
magnatronus committed Apr 14, 2020
1 parent 52342e4 commit b6560b8
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ldbs-json changelog

## 1.1.2 (Apr 2020)
Add missing namespace attribute for filterList (PR from SimonRice)

## 1.1.1 (Dec 2019)
By default attributes are removed from the returned data Now they can be included.

Expand Down
20 changes: 20 additions & 0 deletions examples/getNextDeparturesStaff.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Simple example code for running the STAFF version of the DepartureBoard Info
* NB: You will need a valid Token to access the SV version of the api
*/
const LiveDepartureBoardService = require('../index');
const token = "0000-0000-0000-0000"; // put a valid token here


// Set up the options for the call
const options = {
crs:"SVG",
filterList: ["KGX"],
time: "2020-04-14T08:30:00",
timeWindow:120
};

const api = new LiveDepartureBoardService(token, true);
api.call("GetNextDepartures", options).then(board => {
console.log(board);
});
20 changes: 20 additions & 0 deletions examples/getNextDeparturesUser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Simple example code for running the user version of the DepartureBoard Info
* NB: You will need a valid Token to access the SV version of the api
*/
const LiveDepartureBoardService = require('../index');
const token = "0000-0000-0000-0000"; // put a valid token here

// Set up the options for the call
const options = {
crs:"SVG",
filterList: ["KGX"],
time: "2020-04-14T08:30:00",
timeWindow:120,
timeOffset: 0
};

const api = new LiveDepartureBoardService(token, false);
api.call("GetNextDepartures", options).then(board => {
console.log(board);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ldbs-json",
"version": "1.1.1",
"version": "1.1.2",
"engines": {
"node": ">=7.6"
},
Expand Down

0 comments on commit b6560b8

Please sign in to comment.