module Instagram::Client::Media

Defines methods related to media items

Public Instance Methods

media_item(*args) click to toggle source

Returns extended information of a given media item

@overload media_item(id)

@param user [Integer] An Instagram media item ID
@return [Hashie::Mash] The requested media item.
@example Return extended information for media item 1234
  Instagram.media_item(1324)

@format :json @authenticated false unless requesting media from a protected user

If getting this data of a protected user, you must authenticate (and be allowed to see that user).

@rate_limited true @see instagram.com/developer/endpoints/media/#get_media

# File lib/instagram/client/media.rb, line 18
def media_item(*args)
  id = args.first || 'self'
  response = get("media/#{id}")
  response
end
media_shortcode(*args) click to toggle source

Returns extended information of a given media item

@overload media_shortcode(shortcode)

@param shortcode [String] An Instagram media item shortcode
@return [Hashie::Mash] The requested media item.
@example Return extended information for media item with shortcode 'D'
  Instagram.media_shortcode('D')

@format none @authenticated false unless requesting media from a protected user

If getting this data of a protected user, you must authenticate (and be allowed to see that user).

@rate_limited true @see instagram.com/developer/endpoints/media/#get_media_by_shortcode

# File lib/instagram/client/media.rb, line 37
def media_shortcode(*args)
  shortcode = args.first
  response = get("media/shortcode/#{shortcode}", {}, false, false, true)
  response
end