Module: Instagrammer::Utils

Included in:
Post, User
Defined in:
lib/instagrammer/utils.rb

Instance Method Summary collapse

Instance Method Details

#get_page_statusObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/instagrammer/utils.rb', line 4

def get_page_status
  if page.has_content?("Private")
    :private
  elsif page.has_content?("Sorry")
    :not_found
  elsif page.find(:json_ld, visible: false)
    :public
  end
rescue Capybara::ElementNotFound
  :invalid
end