lib/insta_scraper/html/media.rb in insta_scraper-0.3.0 vs lib/insta_scraper/html/media.rb in insta_scraper-0.4.0

- old
+ new

@@ -1,17 +1,19 @@ module InstaScraper class HTML::Media < InstaScraper::HTML - attr_reader :code + attr_reader :code, + :params - def initialize(code = nil, html = nil) + def initialize(code = nil, html = nil, params = {}) raise ArgumentError, 'Provide a code or html string' if !code && !html @code = code @html = html + @params = params end def url - "https://www.instagram.com/p/#{code}/" + "https://www.instagram.com/p/#{code}/#{serialize_params}" end def data @data ||= Hashie::Mash.new(::JSON.parse(shared_data))