1.1.4 • Published 6 years ago

mysbb v1.1.4

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

getsbb

sbb Infos

NodeJS klasse für die Zuginformationen in der Schweiz NodejsClass for the Traininformation in switzerland

$ npm install mysbb

Usage

var sbb = require('mysbb')

Initialize Connection

var firstconnection = new sbb("bern","biel")
var secondconnection = new sbb("bern","zürich")
var thirdconnection = new sbb("bern","olten")

Play with results

 bernBiel= firstconnection.result()
        bernBiel.then(function(result){
            //do stuff
            console.log(result)
        })

    bernZürich= secondconnection.result();
        bernZürich.then(function(result){
        //do stuff
        console.log(result)
    })

    bernOlten= thirdconnection.result();
        bernOlten.then(function(result){
        //do stuff
        console.log(result)
    })

output example:

[{
    "DepartureName": [ "Bern", "Bern", "Bern", "Bern" ],
    "DepartureTime": [ "04:21", "04:40", "05:29", "06:02" ],
    "DeparturePlatform": [ "6", "8", "3", "7" ],
    "DepartureDelay": [ 2, null, null, null ],
    "ArrivalName": [ "Olten", "Olten", "Olten", "Olten" ],
    "ArrivalTime": [ "04:46", "05:25", "05:55", "06:28" ],
    "ArrivalPlatform": [ "7", "7", "7", "7" ],
    "AllFrom": [ [Object], [Object], [Object], [Object] ],
    "AllTo": [ [Object], [Object], [Object], [Object] ] } ]
}]    

Output AllTO:

[ { "station":
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null },
    arrival: '2017-01-02T04:46:00+0100',
    arrivalTimestamp: 1483328760,
    departure: null,
    departureTimestamp: null,
    delay: null,
    platform: '7',
    prognosis:
     { platform: null,
       arrival: null,
       departure: null,
       capacity1st: null,
       capacity2nd: null },
    realtimeAvailability: 'RT_BHF',
    location:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null } },
  { station:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null },
    arrival: '2017-01-02T05:25:00+0100',
    arrivalTimestamp: 1483331100,
    departure: null,
    departureTimestamp: null,
    delay: null,
    platform: '7',
    prognosis:
     { platform: null,
       arrival: null,
       departure: null,
       capacity1st: null,
       capacity2nd: null },
    realtimeAvailability: 'RT_BHF',
    location:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null } },
  { station:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null },
    arrival: '2017-01-02T05:55:00+0100',
    arrivalTimestamp: 1483332900,
    departure: null,
    departureTimestamp: null,
    delay: null,
    platform: '7',
    prognosis:
     { platform: null,
       arrival: null,
       departure: null,
       capacity1st: null,
       capacity2nd: null },
    realtimeAvailability: 'RT_BHF',
    location:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null } },
  { station:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null },
    arrival: '2017-01-02T06:28:00+0100',
    arrivalTimestamp: 1483334880,
    departure: null,
    departureTimestamp: null,
    delay: null,
    platform: '7',
    prognosis:
     { platform: null,
       arrival: null,
       departure: null,
       capacity1st: null,
       capacity2nd: null },
    realtimeAvailability: 'RT_BHF',
    location:
     { id: '8500218',
       name: 'Olten',
       score: null,
       coordinate: [Object],
       distance: null } } ]
1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1-b

6 years ago

1.1.1-a

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago