Methods
backlinks(aggregatedopt, limitopt) → {Promise}
Paginated backlinks from page
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
aggregated |
Boolean
|
<optional> |
return all backlinks (default is true) |
limit |
Number
|
<optional> |
number of backlinks per page |
Returns:
- Type:
-
Promise
- includes results [and next function for more results if not aggregated]
categories(aggregatedopt, limitopt) → {Promise}
Paginated categories from page
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
aggregated |
Boolean
|
<optional> |
return all categories (default is true) |
limit |
Number
|
<optional> |
number of categories per page |
Returns:
- Type:
-
Promise
- returns results if aggregated [and next function for more results if not aggregated]
Example
wiki().page('batman').then(page => page.categories()).then(console.log);
content() → {Promise}
Useful for extracting structured section content from the page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.content()).then(console.log);
coordinates() → {Promise}
Geographical coordinates from page
Returns:
- Type:
-
Promise
Example
wiki().page('Texas').then(texas => texas.coordinates())
externalLinks() → {Promise}
External links from page
Returns:
- Type:
-
Promise
Example
wiki().page('batman').then(page => page.externalLinks()).then(console.log);
// or
wiki().chain().search('batman').extlinks().request()
fullInfo() → {Promise}
Get the full infobox data, parsed in a easy to use manner
Returns:
- Type:
-
Promise
- Parsed object of all infobox data
Example
new Wiki().page('Batman').then(page => page.fullInfo()).then(info => info.general.aliases);
html() → {Promise}
HTML from page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.html()).then(console.log);
images() → {Promise}
Image URL's from page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.image()).then(console.log);
info(keyopt) → {Promise}
Get general information from page, with optional specifc property
- Deprecated:
- This method will be dropped and replaced with the `fullInfo` implementation in v5
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String
|
<optional> |
Information key. Falsy keys are ignored |
Returns:
- Type:
-
Promise
- info Object contains key/value pairs of infobox data, or specific value if key given
Example
wiki().page('Batman').then(page => page.info('alter_ego'));
langlinks() → {Promise}
Get list of links to different translations
Returns:
- Type:
-
Promise
- includes link objects { lang, title, url }
links(aggregatedopt, limitopt) → {Promise}
Paginated links from page
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
aggregated |
Boolean
|
<optional> |
return all links (default is true) |
limit |
Number
|
<optional> |
number of links per page |
Returns:
- Type:
-
Promise
- returns results if aggregated [and next function for more results if not aggregated]
Example
wiki().page('batman').then(page => page.links()).then(console.log);
mainImage() → {Promise}
Main image URL from infobox on page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.mainImage()).then(console.log);
rawContent() → {Promise}
Raw content from page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.rawContent()).then(console.log);
rawImages() → {Promise}
Raw data from images from page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.rawImages()).then(console.log);
references() → {Promise}
References from page
Returns:
- Type:
-
Promise
Example
wiki().page('batman').then(page => page.references()).then(console.log);
summary() → {Promise}
Text summary from page
Returns:
- Type:
-
Promise
Example
wiki.page('batman').then(page => page.summary()).then(console.log);
tables() → {Promise}
Fetch and parse tables within page
Returns:
- Type:
-
Promise
Resolves to a collection of tables