Sha256: f44d1f1a4a76e6e12d2950c511c3a8b9a4740d443ebb89a312e73cdc49d71139

Contents?: true

Size: 1.91 KB

Versions: 23

Compression:

Stored size: 1.91 KB

Contents

module Foursquare2
  module Photos

    # Retrieve a photo
    #
    # @params [String] photo_id - The ID of the photo

    def photo(photo_id)
      response = connection.get("photos/#{photo_id}")
      return_error_or_body(response, response.body.response.photo)
    end    

    # Add a photo
    #
    # @param [Hash] options
    # @option options UploadIO :photo - the photo. Like Faraday::UploadIO.new('pic_path', 'image/jpeg')
    # @option options String :checkinId - the ID of a checkin owned by the user
    # @option options String :tipId - the ID of a tip owned by the user
    # @option options String :venueId - the ID of a venue
    # @option options String :broadcast - Required, one or more of private,public,facebook,twitter. Comma-separated.
    # @option options String :ll - Latitude and longitude in format LAT,LON
    # @option options Integer :llAcc - Accuracy of the lat/lon in meters.
    # @option options Integer :alt - Altitude in meters
    # @option options Integer :altAcc - Accuracy of the altitude in meters
    def add_photo(options={})
      response = connection.post('photos/add', options)
      return_error_or_body(response, response.body.response.photo)
    end
    
    # Retrieve photos for a venue
    #
    # @params [String] venue_id - The ID of the venue
    # @param [Hash] options
    # @option options String :group - Pass checkin for photos added by friends (including on their recent checkins). Pass venue for public photos added to the venue by non-friends. Use multi to fetch both. Default - venue
    # @option options Integer :limit - Number of results to return, up to 500.
    # @option options Integer :offset - Used to page through results.
    def venue_photos(venue_id, options = {:group => 'venue'})
      response = connection.get do |req|
        req.url "venues/#{venue_id}/photos", options
      end
      return_error_or_body(response, response.body.response.photos)
    end
    
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
foursquare2-1.9.8 lib/foursquare2/photos.rb
foursquare2-1.9.7 lib/foursquare2/photos.rb
foursquare2-1.9.6 lib/foursquare2/photos.rb
foursquare2-1.9.5 lib/foursquare2/photos.rb
foursquare2-1.9.4 lib/foursquare2/photos.rb
foursquare2-1.9.3 lib/foursquare2/photos.rb
foursquare2-1.9.2 lib/foursquare2/photos.rb
foursquare2-1.9.1 lib/foursquare2/photos.rb
foursquare2-1.9.0 lib/foursquare2/photos.rb
foursquare2-1.8.2 lib/foursquare2/photos.rb
foursquare2-1.8.1 lib/foursquare2/photos.rb
foursquare2-1.8.0 lib/foursquare2/photos.rb
foursquare2-1.7.0 lib/foursquare2/photos.rb
foursquare2-1.6.0 lib/foursquare2/photos.rb
foursquare2-1.5.0 lib/foursquare2/photos.rb
foursquare2-1.4.2 lib/foursquare2/photos.rb
foursquare2-1.4.0 lib/foursquare2/photos.rb
foursquare2-1.3.6 lib/foursquare2/photos.rb
foursquare2-1.3.5 lib/foursquare2/photos.rb
foursquare2-1.3.4 lib/foursquare2/photos.rb