Good data is useless if it's hard to access.
CTA Redux takes obscure data from the
Chicago Transit Authority and makes it easy to use.
require 'cta_redux'
CTA::TrainTracker.key = 'foo'
# Access GTFS data with the power of Sequel
api_response = CTA::Stop.first(:stop_name => "Armitage").predictions!
api_response.predictions.each do |p|
puts "A #{p.direction} #{p.route.long_name} train will be arriving at Armitage in #{p.minutes} minutes."
end
$ ruby ~/test.rb
A Loop-bound Brown Line train will be arriving at Armitage in 3 minutes.
A Loop-bound Brown Line train will be arriving at Armitage in 12 minutes.
Features
Clean, consistent access to the TrainTracker, BusTracker, and Customer Alerts APIs.
Powerful integration with GTFS/Scheduled Service Data, through the Sequel ORM.
Built-in support for caching API responses via Faraday. Use the built-in cache, or replace it with anything that quacks like an ActiveSupport::Cache.