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

big_brother_pr

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

big_brother_pr

  • 1.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

big_brother_pr

Build Status Gem Version Dependency Status Code Climate 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

  • 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

FAQs

Package last updated on 06 Aug 2017

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