0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby client and library for ITS/DTOP's Traffic Cameras API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15.3
>= 0
~> 12.0
>= 0

Runtime

~> 1.4.4
~> 0.15.6
 Project Readme

big_brother_pr

Build Status Gem Version Maintainability security

A Ruby client and library for ITS/DTOP's Traffic Cameras API.

Why

Currently DTOP's Intelligent Transportation Systems (ITS) Project for Puerto Rico has an API that lists 3-second delayed images from traffic cameras throughout the island. Besides this (unlisted) api, the only other way to get an (incomplete) list of the cameras is to use ITS DTOP's site. This gem helps by doing a few *clever things in order to provide you a complete and cleaner response.

*API endpoint enumeration + deep merge, reverse-geocoding, url cleanup, CamelCase to camelBack json responses...

Installation

gem install big_brother_pr

Usage

Basic Example Code

require 'big_brother_pr'

traffic_cams = BigBrotherPR.find_all_cameras
=> [{"id"=>1,
"name"=>"AGUADILLA-CAM 01",
"location"=>"PR-2 INT PR-110 NORTE",
"dateTime"=>"25/5/2015 11:36:34 PM",
"imageSource"=>"http://its.dtop.gov.pr/images/cameras/AGDLLACAM01/AGDLLACAM01.jpg",
"latitude"=>18.452983, "longitude"=>-67.091931, "hasCoordinates"=>true}]

Additional Example

require 'big_brother_pr'

client = BigBrotherPR::Client.new

client.find_all_cameras
client.save # saves (parsed) json response to disk (traffic_cams.json)

Saved Response Example

[{
    "id":11,
    "name":"CULEBRA-CAM 01",
    "location":"TERMINAL ATM CULEBRA ",
    "dateTime":"25/5/2015 11:34:41 PM",
    "imageSource":"http://its.dtop.gov.pr/images/cameras/CULEBRACAM01/CULEBRACAM01.jpg",
    "latitude":18.301125,
    "longitude":-65.302297,
    "hasCoordinates":true
  }]

Projects using this gem

  • TrafficCamPR - A CCTV-style Dashboard for visualizing all ITS/DTOP traffic cameras in Puerto Rico. (built with EmberJS)

Authors

BigBrotherPR logo

  • Designed by my girlfriend, Gloria ₍˄·͈༝·͈˄₎ฅ˒˒

Contributing

Is it worth it? let me fork it

I put my thing down, flip it and debug it

Ti gubed dna ti pilf nwod gniht ym tup I

Ti gubed dna ti pilf nwod gniht ym tup I