Class: InstaScraper::JSON::MediaComment

Inherits:
InstaScraper::JSON show all
Defined in:
lib/insta_scraper/json/media_comment.rb

Instance Attribute Summary collapse

Attributes inherited from InstaScraper::JSON

#response

Instance Method Summary collapse

Methods inherited from InstaScraper::JSON

#data, #raw_json

Constructor Details

#initialize(shortcode, last_comment_id, per_page = 20) ⇒ MediaComment

Returns a new instance of MediaComment.



7
8
9
10
11
12
# File 'lib/insta_scraper/json/media_comment.rb', line 7

def initialize(shortcode, last_comment_id, per_page = 20)
  warn 'Instagram changed things, this no longer works, use MediaCommentStream'
  @shortcode       = shortcode
  @last_comment_id = last_comment_id
  @per_page        = per_page
end

Instance Attribute Details

#last_comment_idObject (readonly)

Returns the value of attribute last_comment_id.



3
4
5
# File 'lib/insta_scraper/json/media_comment.rb', line 3

def last_comment_id
  @last_comment_id
end

#per_pageObject (readonly)

Returns the value of attribute per_page.



3
4
5
# File 'lib/insta_scraper/json/media_comment.rb', line 3

def per_page
  @per_page
end

#shortcodeObject (readonly)

Returns the value of attribute shortcode.



3
4
5
# File 'lib/insta_scraper/json/media_comment.rb', line 3

def shortcode
  @shortcode
end

Instance Method Details

#urlObject



14
15
16
# File 'lib/insta_scraper/json/media_comment.rb', line 14

def url
  "https://www.instagram.com/query/?q=ig_shortcode(#{shortcode}){comments.before(#{last_comment_id},#{per_page}){count,nodes{id,created_at,text,user{id,profile_pic_url,username,follows{count},followed_by{count},biography,full_name,media{count},is_private,external_url,is_verified}},page_info}}"
end