1.0.3 • Published 9 years ago

youbike-js v1.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

Youbike

Youbike is a module for obtaining Youbike(Taiwan public bicycle) information.

Installation

npm install youbike-js

Usage

var youbike = require('youbike-js');

// Options:
// location:  'tpe' or 'ntp' or 'tch' or 'chg' or 'tao'
// no:        0~n or 'all'

youbike.getYoubikeJSONData({loc: "tpe",no: '1'}, function(err, result){
    if(err) 
        console.log(err);
    else
        console.log("result: " + JSON.stringify(result)); 
});
/*
{
    sno: "0002",
    sna: "捷運國父紀念館站(2號出口)",
    sarea: "大安區",
    ar: "忠孝東路四段/光復南路口(西南側)",
    tot: "48",
    sbi: "28",
    bemp: "20",
    lat: "25.041254",
    lng: "121.55742",
    mday: "20160608103129",
    sv: "1",
    sbi_img: "/api/test/nt_getimg.php?x1=4769&x2=4731&flag=3&t=1465353149",
    bemp_img: "/api/test/nt_getimg.php?x1=4769&x2=4731&flag=4&t=1465353149"
}
*/

youbike.getYoubikeJSONDataLength({loc: "tpe"}, function(err, result){
    if(err) 
        console.log(err);
    else
        console.log("total number: " + result); 
});

/*
total number: 243
*/

Notes

  • It uses data from https://www.youbike.com.tw/

License

Licensed under The MIT License (MIT)
For the full copyright and license information, please view the LICENSE.txt file.

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago