Module: Instagram::Client::Comments

Included in:
Instagram::Client
Defined in:
lib/instagram/client/comments.rb

Overview

Defines methods related to comments

Instance Method Summary collapse

Instance Method Details

#create_media_comment(id, text) ⇒ Hashie::Mash

Creates a comment for a given media item ID

Returns The comment created.

Examples:

Creates a new comment on media item with ID 777

Instagram.create_media_comment(777, "Oh noes!")

See Also:

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • true

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


37
38
39
40
# File 'lib/instagram/client/comments.rb', line 37

def create_media_comment(id, text, options={})
  response = post("media/#{id}/comments", options.merge(:text => text), signature=true)
  response
end

#delete_media_comment(media_id, comment_id) ⇒ nil

Deletes a comment for a given media item ID

Examples:

Delete the comment with ID of 1234, on the media item with ID of 777

Instagram.delete_media_comment(777, 1234)

See Also:

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • true

    In order to remove a comment, you must be the owner of the comment, the media item, or both.


56
57
58
59
# File 'lib/instagram/client/comments.rb', line 56

def delete_media_comment(media_id, comment_id, options={})
  response = delete("media/#{media_id}/comments/#{comment_id}", options, signature=true)
  response
end

#media_comments(id) ⇒ Hashie::Mash

Returns a list of comments for a given media item ID

Returns The requested comments.

Examples:

Returns a list of comments for the media item of ID 1234

Instagram.media_comments(777)

See Also:

Rate Limited:

  • true

Supported formats:

  • :json

Requires Authentication:

  • true

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


18
19
20
21
# File 'lib/instagram/client/comments.rb', line 18

def media_comments(id, *args)
  response = get("media/#{id}/comments")
  response
end