Hong Kong Tramways Unofficial API
What is this for?
Trams are a special and historic means of transport in Hong Kong. They are cheap, fun and generally reliable. However there isn"t an easy way to access information about them until recently. Hong Kong Tramways have made public next tram, schedule and fare information available online. This is an easy module to get the data so you can automate things.
For example, you could have a display at home with real-time next tram info.
npm install --save hongkong-trams
When creating the instance, you can pass some options, for now, only the language code is supported, possible values are "en" English, "tc" Traditional Chinese or "sc" Simplified Chinese.
var HongKongTrams = ;var trams = ;trams;
By default a new random useragent string is generated when the object is created. If you want to override this, please pass your useragent string into the options, for example:
var trams = ;
All methods return JSON, please see the examples linked above for more info on how to call each method. Here is an example of what get
Other Handy Modules
- hongkong-weather - For Hong Kong Weather Information.
- hongkong-pollution - For Hong Kong Pollution Information.
Feel free to submit any pull requests or add functionality, I"m usually pretty responsive.
If you like the module, please consider donating some bitcoin or litecoin.