GithubHelp home page GithubHelp logo

cta-bus-texter's Introduction

Search for CTA bus arrival times with a simple text; no stop id required. Request maps as static image files. For getting places without compromising your lo-fi dumbphone aesthetic.

Setting it Up

This is a Sinatra app. It uses the twilio-ruby gem to handle sending and receiving texts. You'll need your own Twilio account and text-enabled phone number. (Trial accounts are free but have some restrictions.)

I have an .env file that looks like this (all values from Twilio, Google, the CTA, etc.):

TWILIO_ACCOUNT_SID  
TWILIO_AUTH_TOKEN  
TWILIO_NUM  
ALLOWED_PHONE_NUMBERS  
CTABUS_KEY  
GOOGLE_STATIC_MAPS_KEY  
GOOGLE_STATIC_MAPS_SECRET  
DICTIONARY_KEY  

This app uses Postgres and ActiveRecord to manage bus stop details. Geocoding by the geocoder gem.

Options

This app understands the following requests:

  • HelpMe
    Returns a list of available options. ("Help" alone calls up Twilio's help menu, not ours.)
  • Map [location]
    Returns a map of that location as a static image file. The location can be an address, intersection, zip code, etc. Defaults to Chicago.
  • Bus [location] [direction]
    Returns arrival times for the nearest bus stop.
  • Define [word]
    For reading on the bus.

Running it Locally

To test the app locally:

  1. Start the server by running rackup in the terminal. Get the port number (something like 9292).
  2. Point nrgok toward that port: ngrok 9292.
  3. Grab the ngrok url (something like https://123a4bcd.ngrok.com) from your terminal.
  4. Go to the phone number configuration page of your Twilio account. Under "Messaging," add your ngrok url to the "Request URL" box.

When you're ready to push the app to Heroku or wherever, be sure to replace the ngrok url with the hosted one.

cta-bus-texter's People

Contributors

rexlane avatar

Stargazers

Tim Kelly avatar Seth Herr avatar

Watchers

James Cloos avatar Seth Herr avatar  avatar

cta-bus-texter's Issues

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.