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?
Looks up a web page by URL variants and returns Genius metadata.
Class Method Details
.lookup(token: nil, options: {}) ⇒ Hash?
Looks up a web page by URL variants and returns Genius metadata.
13 14 15 16 17 18 19 20 21 |
# File 'lib/genius/api/web_pages.rb', line 13 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}").body JSON.parse(response) end |