Shiny Contest Submission: Real time public transport info for Dublin, Ireland

The current Dublin Bus (Ireland) website and app will only allow you to view information for a single bus stop. This frustrated me into creating this Shiny app.

I can commute home using a number of different bus stops. This Shiny app will collate the information on a number of different bus stops and filter out the relevant buses for the user.
The search query string in the URL can be used to pre-populate the bus stop numbers and buses selected.

There's also a straight forward API for DART (Dublin Area Rapid Transport) information which I incorporated into the app.

Links

Shiny App Note: this will only be useful between 07:00 UTC and 23:30 UTC
RStudio Cloud
Github

UI

The UI is simple, choose your bus stops and then select your buses.

Features

Gathering Data

The information for the buses is scraped from dublinbus.ie. It's reasonably straight forward to parse the data using the rvest and the stringr packages.

The train data comes from a public API.

Custom URL

To avoid having to re-select the bus stops and filter the buses each time the app is loaded, there is an option to include query strings in the URL.

Example: http://aboland.shinyapps.io:/DublinTransport/?stops=334,336&routes=14,140

The Create Custom URL action button in the sidebar of the app will display the currently selected options in a custom URL.

This functionality is possible using session$clientData within the Shiny server code. A popup box displays the URL

Auto Refresh

There's also an option to periodically refresh the information.

This is easily done using the invalidateLater Shiny function.
See code here.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.