0.1.2 • Published 5 years ago

hubot-wpgtransit v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

hubot-wpgtransit

npm version

Hubot plugin to get bus schedule information from the Winnipeg Transit Open Data API

Installation

  • Run the npm install command
npm install hubot-wpgtransit --save
  • Add the following code in your external-scripts.json file.
["hubot-wpgtransit"]
  • You will need to obtain an API key here in order to use this script.
  • Export your API key as an environment variable
export HUBOT_WPGTRANSIT_KEY=ABCDEFGHIJKLMNOPXRSTUVWXYZ

Usage

  • Search for a stop by name
hubot> hubot bus search Eastbound Portage
hubot> Search Results (limited to 25):
Stop Number 10562 | Eastbound Portage at Tylehurst (Polo Park)
Stop Number 10563 | Eastbound Portage at St. John Ambulance
Stop Number 10564 | Eastbound Portage at Raglan
Stop Number 10565 | Eastbound Portage at Craig
Stop Number 10566 | Eastbound Portage at Clifton
...
  • Get the schedule info for a stop
hubot> hubot bus schedule 10562
hubot> Stop Number 10562 | Eastbound Portage at Tylehurst (Polo Park)
 Time - Route
12:49 - [11] Glenway
12:50 - [11] North Kildonan via Rothesay
12:51 - [21] City Hall
12:55 - [79] Polo Park via Kenaston
12:56 - [78] Polo Park via Kenaston
12:56 - [24] City Hall
12:59 - [11] North Kildonan via Donwood
... 
  • Get the schedule info for the last stop you searched
hubot> hubot bus schedule 
hubot> Stop Number 10562 | Eastbound Portage at Tylehurst (Polo Park)
 Time - Route
12:49 - [11] Glenway
12:50 - [11] North Kildonan via Rothesay
12:51 - [21] City Hall
12:55 - [79] Polo Park via Kenaston
12:56 - [78] Polo Park via Kenaston
12:56 - [24] City Hall
12:59 - [11] North Kildonan via Donwood
...

Configuration

You may set the below environment variables for further configuration options

Environment variableRequiredValueNotes
HUBOT_WPGTRANSIT_KEYRequired(String) Winnipeg transit OpenData API KeyObtain a key here
HUBOT_WPGTRANSIT_URLOptional(URL) Default: https://api.winnipegtransit.com/v2/Should not need to set this unless the API URL changes
0.1.2

5 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago