Class: AbstractLookupAdapter

(abstract) AbstractLookupAdapter(updateCallback)

Adapter that, given a URL, looks up metadata that can identify a review subject, such as a book's title or a restauraunt name.

Constructor

(abstract) new AbstractLookupAdapter(updateCallback)

Parameters:
Name Type Description
updateCallback function

(optional) callback to run after a successful lookup

Source:

Members

sourceID :String

Canonical identifier for this source. Lower-case string, no whitespace.

Type:
  • String
Source:

supportedPattern :RegExp

RegExp for URLs this adapter can handle.

Type:
  • RegExp
Source:

Methods

ask(url) → {Boolean}

Does this adapter support the given URL? By default, performs a simple regex check.

Parameters:
Name Type Description
url String

the URL to test

Source:
Returns:

true if supported

Type
Boolean

getSourceID() → {String}

Return the canonical source identifier for this adapter

Source:
Returns:
Type
String

(abstract) lookup(_url) → {Promise}

Perform a lookup for a given URL.

Parameters:
Name Type Description
_url String

the URL to perform lookup for

Source:
Returns:

promise that resolves with a result object of the form LookupResult on success, and rejects with an error on failure

Type
Promise