class InstaScraper::HTML
Public Instance Methods
data()
click to toggle source
# File lib/insta_scraper/html.rb, line 7 def data @data ||= Hashie::Mash.new(::JSON.parse(shared_data)) .extend(Hashie::Extensions::DeepFetch) .extend(Hashie::Extensions::DeepFind) end
html()
click to toggle source
# File lib/insta_scraper/html.rb, line 3 def html @html ||= get_html end
Protected Instance Methods
serialize_params()
click to toggle source
# File lib/insta_scraper/html.rb, line 16 def serialize_params return '' if params.empty? "?" + params.map {|k, v| "#{k}=#{v}"}.join('&') end
Private Instance Methods
get_html()
click to toggle source
# File lib/insta_scraper/html.rb, line 24 def get_html open(url).read end
line_with_data()
click to toggle source
# File lib/insta_scraper/html.rb, line 28 def line_with_data html.each_line.detect { |l| l[/sharedData/] } end