Sha256: 71e6d95bdc2bf57f8aec3b78af7029a0fecaf576d3bd2f69782f5975905e06e4
Contents?: true
Size: 599 Bytes
Versions: 2
Compression:
Stored size: 599 Bytes
Contents
module InstaScraper class HTML def html @html ||= get_html end protected def serialize_params return '' if params.empty? "?" + params.map {|k, v| "#{k}=#{v}"}.join('&') end private def get_html open(url).read end def line_with_data html.each_line.detect { |l| l[/sharedData/] } end def shared_data line_with_data[shared_data_start..shared_data_end] end def shared_data_start (line_with_data =~ /sharedData/) + 13 end def shared_data_end line_with_data =~ /\};</ end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
insta_scraper-0.5.0 | lib/insta_scraper/html.rb |
insta_scraper-0.4.0 | lib/insta_scraper/html.rb |