Skip to content

Latest commit

 

History

History
83 lines (65 loc) · 2.13 KB

README.rdoc

File metadata and controls

83 lines (65 loc) · 2.13 KB

PanoramioRb

PanoramioRb gem allows you to get geolocated photos from Panoramio.com as a Ruby Object.

Installation

In your Gemfile:

gem 'panoramio-rb'

Or by command line

gem install panoramio-rb

Usage

require 'rubygems'
require 'panoramio-rb'
panoramio = PanoramioRb.get_panoramas(
  minx: -72.69483717012992,
  miny: -13.307931783110847,
  maxx: -72.39756282987008,
  maxy: -13.018468216889152)

# Or use
panoramio = PanoramioRb.get_panoramas_from_point([-13.1632,-72.5462])

# To get photos
panoramio.photos

# To get global total photos
panoramio[:count]

# To verify if has more photos
panoramio.has_more

# Photos structure:
photo = panoramio.photos.first
photo.photo_id
photo.photo_title
photo.photo_url
photo.photo_file_url
photo.longitude
photo.latitude
photo.width
photo.height
photo.upload_date
photo.owner_id
photo.owner_name
photo.owner_url

Options for get_panoramas function

:set
  Type of photos. Uses :public (by default) for popular photos. Use :full to get all photos, or a Panoramio User ID.

:size
  Photos size. You can use :original, :medium (by default), :thumbnail, :square, :mini_square

:from
  From collection photos. Default 0

:to
  To collection photos. Default 20

:mapfilter
  Default true. When the mapfilter parameter is set to true, photos are filtered such that they look
  better when they are placed on a map. It takes into account the location and tries to avoid of
  returning photos of the same location.

:minx, :miny, :maxx, and :maxy
  These values define the area to show photos from (minimum longitude, latitude, maximum longitude
  and latitude, respectively).

Options for get_panoramas_from_point function

:point
  Array with Latitude, Longitude values
:radius
  Distance from point. Default 10
:unit
  Distance unit. Default :mi (miles). You can use too kilometers (:km)
:options
  Hash values. The same options for get_panoramas function

Resources