A webservice and a web tile for Microsoft Band to display Budapest public transport information using BKK Futár data service.
The Centre of Budapest Transport (BKK) provides a webservice that anyone can use to get data about lines, stops and vehicles of public transport. The goal of this project is to display the most important information from this data feed on a Microsoft Band.
The BKK webservice allows querying vehicles by stops, however the data returned is not optimal for displaying on a Band. Therefore this project contains a Node.js webservice that calls into the BKK webservice, and transforms the results to a Band-optimized JSON result. This webservice can be deployed to any host, and can be called directly from a Band web tile.
In this project you can find the following folders:
- The
src
folder contains the Node.js webservice. It is written in EcmaScript 2015 (ES6) using the Hapi server. - The
webtile
folder contains the files required to build a webtile for Microsoft Band. - The
typings
folder contains TypeScript type information that Visual Studio Code can directly use to provide better developer experience.
Disclaimer: This is a proof-of-concept sample that I use on my Band, but it is not meant to be a production code.
If you want to create a similar solution for yourself, follow these steps:
- Fork this repo.
- Find out the IDs of the stops you are interested in. See the Acknowledgements section.
- Customize the stops in the
src/next-ride/controller.js
file. - Deploy this service to a webserver. I use Azure Web Apps for this, and it works perfectly fine.
- Customize the
url
in thewebtile/manifest.json
file. - Create a ZIP package from the content of the
webtile
folder and deploy it to your phone.
Thanks for Kiss McGee to create the Apiary documentation of the BKK FUTÁR Utazástervező API,
the webservice this solution relies on. The src/next-ride/service.js
file calls the
ArrivalsAndDeparturesForStop API.
Thanks for Gábor Nádai (Mefi) for the KoviBusz repository here on Github. The hosted version of his application helped me (and you too) to easily find the ID of the stops I'm interested in.
Thanks for Tamás Mágedli for the UrbanJS toolset which is used by this project for static code analysis.
- Theoretically the Band udpates the tile in every 15 minutes (see the
refreshIntervalMinutes
value in thewebtile/manifest.json
file), however I've experienced latency in that, sometimes more than 3 hours. - The code in its current state cannot differentiate between lines that uses the same stop.
The following Hungarian blog posts describe the whole project in details:
- BKK Futár Microsoft Bandre - programozási lehetőségek (1. rész)
- BKK Futár Microsoft Bandre - a BKK Futár API (2. rész)
- BKK Futár Microsoft Bandre - service és webtile (3. rész)
This project is maintaned by György Balássy.