Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Count traffic incidents for a given area.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.rvmrc
.travis.yml
Gemfile
Gemfile.lock
README.md
Rakefile
traffic.gemspec

README.md

traffic Build Status

Count traffic incidents for a given area.

The initial implementation provides support for the Bing Traffic Incidents service.

Usage

To get started, you first need to get an API key to access the Bing services.

Traffic Incidents API: http://msdn.microsoft.com/en-us/library/hh441726.aspx

fetcher = Traffic::Fetchers::BingTrafficIncidents.new(
  /bounding_box/ => '39.202,-76.782,39.461,-76.467',
  /api_key/ => '',
  /severities/ => '4'
)

fetcher.fetch

puts fetcher.message   #=> "Request Succeeded"
puts fetcher.data      #=> {"moderate" => 6, "minor" => 1}
Something went wrong with that request. Please try again.