Sha256: 91fb355b4cb38ea13698b3e67e0bd65b67784a38e40fc19210faaaec9dffff8b

Contents?: true

Size: 1.98 KB

Versions: 16

Compression:

Stored size: 1.98 KB

Contents

module Instagram
  class Client
    # Defines methods related to likes
    module Likes
      # Returns a list of users who like a given media item ID
      #
      # @overload media_likes(id)
      #   @param media [Integer] An Instagram media item ID
      #   @return [Hashie::Mash] A list of users.
      #   @example Returns a list of users who like the media item of ID 1234
      #     Instagram.media_likes(777)
      # @format :json
      # @authenticated true
      #
      #   If getting this data of a protected user, you must be authenticated (and be allowed to see that user).
      # @rate_limited true
      # @see TODO:docs url
      def media_likes(id, *args)
        response = get("media/#{id}/likes")
        response["data"]
      end

      # Issues a like by the currently authenticated user, for a given media item ID
      #
      # @overload like_media(id, text)
      #   @param id [Integer] An Instagram media item ID
      #   @return [nil]
      #   @example Like media item with ID 777
      #     Instagram.like_media(777)
      # @format :json
      # @authenticated true
      #
      #   If getting this data of a protected user, you must be authenticated (and be allowed to see that user).
      # @rate_limited true
      # @see TODO:docs url
      def like_media(id, options={})
        response = post("media/#{id}/likes", options)
        response["data"]
      end

      # Removes the like on a givem media item ID for the currently authenticated user
      #
      # @overload unlike_media(id)
      #   @param media_id [Integer] An Instagram media item ID.
      #   @return [nil]
      #   @example Remove the like for the currently authenticated user on the media item with the ID of 777
      #     Instagram.unlike_media(777)
      # @format :json
      # @authenticated true
      # @rate_limited true
      # @see TODO:docs url
      def unlike_media(id, options={})
        response = delete("media/#{id}/likes", options)
        response["data"]
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 5 rubygems

Version Path
instagram_geo-0.8.8 lib/instagram/client/likes.rb
instagram-0.9.0 lib/instagram/client/likes.rb
instagram_geo-0.8.7 lib/instagram/client/likes.rb
instagram-0.8.5 lib/instagram/client/likes.rb
instagram-0.8.4 lib/instagram/client/likes.rb
instagram-0.8.3 lib/instagram/client/likes.rb
instagram-0.8.2 lib/instagram/client/likes.rb
instagram-fixed-0.8.1 lib/instagram-fixed/client/likes.rb
instagram-fixed-0.8 lib/instagram/client/likes.rb
instagram-innonate-0.8 lib/instagram/client/likes.rb
instagram-0.8 lib/instagram/client/likes.rb
instagram-0.7 lib/instagram/client/likes.rb
instagram-0.6.2 lib/instagram/client/likes.rb
localist-instagvram-0.6.2 lib/instagram/client/likes.rb
instagram-0.6.1 lib/instagram/client/likes.rb
instagram-0.6 lib/instagram/client/likes.rb