Sha256: a0a790d0c79bb0b3e9403abcd98b8a0ffb1d76c9ce05b69ae89e31703e363892

Contents?: true

Size: 475 Bytes

Versions: 3

Compression:

Stored size: 475 Bytes

Contents

module InstaScraper
  class HTML
    def html
      @html ||= get_html
    end

    private

    def get_html
      open(url).read
    end

    private

    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

3 entries across 3 versions & 1 rubygems

Version Path
insta_scraper-0.3.0 lib/insta_scraper/html.rb
insta_scraper-0.2.0 lib/insta_scraper/html.rb
insta_scraper-0.1.0 lib/insta_scraper/html.rb