Dublin Bus API v0.1.11 Stop

Dublin Bus API

Access to the Real Time Passenger Information (RTPI) for Dublin Bus services.

The API are focused on retrieving bus stop and timetables

Disclaimer

This service is in no way affiliated with Dublin Bus or the providers of the RTPI service.

Data are retrieved parsing the still-in-development RTPI site. As with any website scraping the html could change without notice and break the API.

Rtpi.ie html parsing work as 2017-4-10

Test

Parsing function are tested both against fixture and the actual website, this could lead to failing test if an internet connection is missing. It also could find if something has changed in the rtpi.ie website html.

Summary

Types

A struct that represent a row in a bus stop timetable, time could be an absolute (16:13) or relative time (5m)

A struct that represent a single stop, it could contain the timetable or the lines that serve the stop

Functions

Return the requested Stop

Return the last time it was checked that the html parsing is still working

Return the last time it was checked that the html parsing is still working as a string (yyyy-MM-dd)

Return a list of Stop matching the query provided. It only returns the first ten results

Types

row()
row() :: %Stop.Row{direction: String.t, line: String.t, time: String.t}

A struct that represent a row in a bus stop timetable, time could be an absolute (16:13) or relative time (5m).

stop()
stop() :: %Stop{lines: [String.t], name: String.t, ref: String.t, timetable: [row]}

A struct that represent a single stop, it could contain the timetable or the lines that serve the stop.

name and ref are always available

Functions

get_info(stop)
get_info(String.t) :: stop
get_info(Integer.t) :: stop

Return the requested Stop

last_time_checked()

Return the last time it was checked that the html parsing is still working

last_time_checked_formatted()

Return the last time it was checked that the html parsing is still working as a string (yyyy-MM-dd)

search(query)
search(String.t) :: [stop]

Return a list of Stop matching the query provided. It only returns the first ten results