Module: Foursquared::Photos

Included in:
Client
Defined in:
lib/foursquared/photos.rb

Overview

photos module

Instance Method Summary collapse

Instance Method Details

#add_photo(options = {}) ⇒ Foursquared::Response::Photo

Add a new photo to a checkin, tip, venue, or page update in general.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :checkinId (String)

    the ID of a checkin owned by the user.

  • :tipId (String)

    the ID of a tip owned by the user.

  • :venueId (String)

    the ID of a venue, provided only when adding a public photo of the venue in general, rather than a photo for a private checkin, tip, or page update.

  • :pageId (String)

    the ID of a page, provided only when adding a photo that will be in an update for that page

  • :broadcast (String)

    Whether to broadcast this photo example: twitter,facebook

  • :public (Integer)

    When the checkinId is also provided this parameter allows for making the photo public and viewable at the venue. 1 or 0

  • :ll (String)

    Latitude and longitude of the user’s location.

  • :llAcc (String)

    Accuracy of the user’s latitude and longitude, in meters.

  • :alt (String)

    Altitude of the user’s location, in meters.

  • :altAcc (String)

    Vertical accuracy of the user’s location, in meters.

  • :postUrl (String)

    A link for more details about the photo.

  • :postContentId (String)

    Identifier for the photo post to be used in a native link

  • :postText (String)

    Text for the photo post, up to 200 characters. A checkinId must also be specified in the request.

Returns:



28
29
30
31
# File 'lib/foursquared/photos.rb', line 28

def add_photo options={}
  response = post("/photos/add", options)["response"]
  @photo = Response::Photo.new(self, response["photo"])
end

#photo(photo_id) ⇒ Foursquared::Response::Photo

Return the photo with the given ID

Parameters:

  • photo_id

    The id of the photo

Returns:



7
8
9
10
# File 'lib/foursquared/photos.rb', line 7

def photo photo_id
  response = get("/photos/#{photo_id}")["response"]
  @photo = Response::Photo.new(self, response["photo"])
end