Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dublinbusjs

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dublinbusjs

Get the Realtime and Stop Information from the Dublin Bus REST API

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

Dublin Bus - RTPI Javascript Client

Dublin Bus Logo

About This

This module gets realtime and stop information from the Dublin Bus REST API. It's really simple to use just look at the examples.

Any bug reports / pull requests are welcome, just follow the contributing guide (At the end of this).

Usage Guide / Examples

You have to install the module before you can use it:

npm install --save dublinbusjs

Now this exposes two functions, getStopData() and getRealtimeData().

const dublinBus = require('dublinbusjs');

dublinBus.getStopData(3787).then(console.log).catch(console.error)

/* Prints:
{
	"stopid": "3787",
	"displaystopid": "3787",
	"shortname": "Skerries Road",
	"shortnamelocalized": "Bóthar na Sceirí",
	"fullname": "Skerries Road",
	"fullnamelocalized": "",
	"latitude": "53.54684889",
	"longitude": "-6.101198889",
	"lastupdated": "12/12/2016 09:03:15",
	"operators": [
		{
			"name": "bac",
			"routes": [
				"33",
				"33X",
				"33A"
			]
		}
	]
}
*/

dublinBus.getRealtimeData(7602).then(console.log).catch(console.error)

/* Prints:
[
	{
		"arrivaldatetime": "14/01/2017 13:16:27",
		"duetime": "43",
		"departuredatetime": "14/01/2017 13:16:27",
		"departureduetime": "43",
		"scheduledarrivaldatetime": "14/01/2017 13:21:00",
		"scheduleddeparturedatetime": "14/01/2017 13:21:00",
		"destination": "Balbriggan",
		"destinationlocalized": "Baile Brigín",
		"origin": "Abbey St",
		"originlocalized": "Sr. na Mainistreach",
		"direction": "Outbound",
		"operator": "bac",
		"additionalinformation": "",
		"lowfloorstatus": "no",
		"route": "33",
		"sourcetimestamp": "14/01/2017 12:16:31",
		"monitored": "true"
	}
]
*/

Contributing

All bug reports and pull requests are welcome! If you wish to add something, make a fix or make a change, just:

  • Fork this repo
  • Add a branch
  • Make your changes
  • Send a pull request!

Make sure to make your changes in the 'src' directory, and run gulp when your finished so it will build!

Keywords

FAQs

Package last updated on 01 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc