Module: Genius::WebPages
- Defined in:
- lib/genius/api/web_pages.rb
Overview
A web page is a single, publicly accessible page to which annotations may be attached. Web pages map 1-to-1 with unique, canonical URLs.
Class Method Summary collapse
-
.lookup(token: nil, options: {}) ⇒ Hash
Genius::WebPages.lookup
-> value.
Class Method Details
.lookup(token: nil, options: {}) ⇒ Hash
Genius::WebPages.lookup
-> value
Information about a web page retrieved by the page's full URL (including protocol). The returned data includes Genius's ID for the page, which may be used to look up associated referents with the /referents endpoint.
Data is only available for pages that already have at least one annotation.
Provide as many of the following variants of the URL as possible:
29 30 31 32 33 34 35 36 37 |
# File 'lib/genius/api/web_pages.rb', line 29 def lookup(token: nil, options: {}) return if token.nil? && !Auth..nil? Errors.validate_token(token) unless token.nil? params = (, %i[raw_annotatable_url canonical_url og_url]) response = HTTParty.get("#{Api::RESOURCE}/?access_token=#{token_ext(token)}#{params}") JSON.parse(response) end |