Giter Site home page Giter Site logo

transitnownash / hubot-nextbus Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.29 MB

๐Ÿš๐Ÿค–Get the next stop time for local transit

Home Page: https://www.npmjs.com/package/hubot-nextbus

License: MIT License

Shell 4.02% JavaScript 95.98%
hubot hubot-scripts transit bus gtfs-rails-api hacktoberfest

hubot-nextbus's Introduction

Hubot Nextbus

npm version Node CI

This Hubot package works with gtfs-rails-api. You provide an endpoint along with a latitude and longitude for it to obtain the next expected bus to a particular set of nearby stops.

Installation

In your hubot repository, run:

npm install hubot-nextbus --save

Then add hubot-nextbus to your external-scripts.json:

["hubot-nextbus"]

Configuration

Environment Variable Optional Description
HUBOT_NEXTBUS_LAT_LON No Default location for hubot nextbus, separated by a comma. (e.g. 36.1629191,-86.7813481)
HUBOT_NEXTBUS_STOP_ID Yes Specific identifier to use with hubot nextbus; if not set, falls back to latitude/longitude
HUBOT_NEXTBUS_BASE_URL Yes URL of a gtfs-rails-api instance; Defaults to Nashville, TN.

Usage

hubot nextbus

Returns the next bus for the nearest stop.

user> hubot nextbus
hubot> Upcoming Trips for [CHA7AWN] CHARLOTTE AVE & 7TH AVE N WB
  7:01 AM   #50 - CHARLOTTE WALMART            in a minute    
  7:15 AM   #17 - GREEN HILLS VIA 12TH AVE S   in 16 minutes  
  7:16 AM   #50 - CHARLOTTE WALMART            in 16 minutes  
  7:31 AM   #50 - CHARLOTTE WALMART            in 31 minutes  
  7:35 AM   #17 - GREEN HILLS VIA 12TH AVE S   in 36 minutes  

hubot nextbus stops

Get the list of stops nearby your configured latitude and longitude.

user> hubot nextbus stops
hubot> List of nearby stops:
hubot> - [CHA7AWN] CHARLOTTE AVE & 7TH AVE N WB
- [CHA7AEN] CHARLOTTE AVE & 7TH AVE N EB
- [6AVDEASN] 6TH AVE & DEADERICK ST SB
- [6AVDEANN] 6TH AVE N & DEADERICK ST NB
- [UNI7AWN] UNION ST & 7TH AVE N WB

hubot nextbus stop <stop id>

Returns the next bus for a given stop ID.

user> hubot nextbus stop PORGRENN
hubot> Upcoming Trips for [PORGRENN] PORTER RD & GREENWOOD AVE NB
  10:34 PM   #4 - INGLEWOOD   in 25 minutes  
  11:34 PM   #4 - INGLEWOOD   in an hour     
  12:32 AM   #4 - INGLEWOOD   in 2 hours 

hubot-nextbus's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar stephenyeargin avatar

Watchers

 avatar

hubot-nextbus's Issues

Spring Cleaning 2018

The following checklist is for all of the Hubot packages I maintain.

README.md

  • Badges (underneath title)
[![npm version](https://badge.fury.io/js/hubot-PACKAGE_NAME.svg)](http://badge.fury.io/js/hubot-PACKAGE_NAME) [![Build Status](https://travis-ci.org/stephenyeargin/hubot-PACKAGE_NAME.png)](https://travis-ci.org/stephenyeargin/hubot-PACKAGE_NAME)
  • Configuration options

package.json

  • author
  "author": "Stephen Yeargin <[email protected]>",
  • repository
  "repository": {
    "type": "git",
    "url": "git://github.com/stephenyeargin/hubot-PACKAGE_NAME.git"
  },
  • bugs
  "bugs": {
    "url": "https://github.com/stephenyeargin/hubot-PACKAGE_NAME/issues"
  },
  • peerDependencies
  "peerDependencies": {
    "hubot": ">=2 <10 || 0.0.0-development"
  },

Gruntfile.js

  • additionalFiles
        additionalFiles: ['package-lock.json']

.travis.yml

  • TravisCI configuration
language: node_js
sudo: false
notifications:
  email: false
node_js:
  - "8" # stable
  - "6" # LTS
  - "4" # maintenance
cache:
  directories:
- node_modules

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.