Class: InstaScraper::JSON::MediaComment
- Inherits:
-
InstaScraper::JSON
- Object
- InstaScraper::JSON
- InstaScraper::JSON::MediaComment
- Defined in:
- lib/insta_scraper/json/media_comment.rb
Instance Attribute Summary collapse
-
#last_comment_id ⇒ Object
readonly
Returns the value of attribute last_comment_id.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#shortcode ⇒ Object
readonly
Returns the value of attribute shortcode.
Attributes inherited from InstaScraper::JSON
Instance Method Summary collapse
-
#initialize(shortcode, last_comment_id, per_page = 20) ⇒ MediaComment
constructor
A new instance of MediaComment.
- #url ⇒ Object
Methods inherited from InstaScraper::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_id ⇒ Object (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_page ⇒ Object (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 |
#shortcode ⇒ Object (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
#url ⇒ Object
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 |