Next bus tiles - OneBusAway integration


#1

Started using WebCore couple of days ago and this is my first example piston.
I wanted to create a dashboard tile that will show a schedule of the bus I’m interested in at a bus stop close to my home.
I’ve used OneBusAway API since it is quite amazing tool - I had very little problems with their app previously.
Current limitations:

  • Puget Sound Metro API URL hardcoded - you may need to update URL for your local data provider - github, API ref
  • it fetches information only for one bus route at one stop. Planning to expand that earlier to support multiple routes on multiple stops later

Calculating timestamps wasn’t easy at all - converting everything to decimal is the only way to fit unix timestamp into variable.