Sha256: e5b6919d7ddce1f23e5f887d7f40bb1a66388f79903ee019ebd2cd2f2fe2c2fd

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

module InstaScraper
  class HTML::Account < InstaScraper::HTML
    attr_reader :username,
                :params

    def initialize(username = nil, html = nil, params = {})
      raise ArgumentError, 'Provide a username or html string' if !username && !html

      @username = username
      @html = html
      @params = params
    end

    def url
      "https://www.instagram.com/#{username}/#{serialize_params}"
    end

    def data
      @data ||=
        Hashie::Mash.new(::JSON.parse(shared_data))
                    .extend(Hashie::Extensions::DeepFetch)
                    .extend(Hashie::Extensions::DeepFind)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
insta_scraper-0.5.0 lib/insta_scraper/html/account.rb
insta_scraper-0.4.0 lib/insta_scraper/html/account.rb