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

cta_redux

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cta_redux

  • 0.3.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

cta_redux

Build Status

The CTA (http://www.transitchicago.com) provides a wealth of information for developers, but it's hard to access, inconsistent, and there are no official clients. CTA Redux is an easy to use, comprehensive client for that data.

This gem combines GTFS data with live API responses to create a consistent view of CTA vehicles and status.

Examples:

require 'cta_redux'

CTA::TrainTracker.key = 'foo'
CTA::BusTracker.key   = 'bar'

# Pick a random stop on the brown line
stop = CTA::Route[:brown].stops.all.sample

routes = []
stop.predictions!.predictions.sort_by(&:seconds).each do |prd|
  routes << prd.route.route_id
  puts "A #{prd.direction} #{prd.route.route_long_name} " +
    "train will be arriving at #{stop.stop_name} in #{prd.minutes} minutes."
end

# Pick a random stop on the 8-Halsted route
stop = CTA::Route["8"].stops.all.sample
stop.predictions!.predictions.sort_by(&:seconds).each do |prd|
  routes << prd.route.route_id
  puts "A(n) #{prd.route.route_id}-#{prd.route.route_long_name} will be " +
    "arriving at #{stop.stop_name} in #{prd.minutes} minutes."
end

CTA::CustomerAlerts.alerts!(:routes => routes.uniq).alerts.each do |alert|
  puts "Alert: #{alert.short_description}"
end

More information is available at (http://www.rubydoc.info/github/ahayworth/cta_redux)

FAQs

Package last updated on 21 Feb 2015

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