page_external_links: Retrieve a page's links

View source: R/metadata.R

page_external_linksR Documentation

Description

page_external_links, when provided with a page title, retrieves external wikilinks from the current revision of that page.

Usage

page_external_links(
  language = NULL,
  project = NULL,
  domain = NULL,
  page,
  protocol = NULL,
  clean_response = FALSE,
  ...
)

Arguments

language

The language code of the project you wish to query, if appropriate.

project

The project you wish to query ("wikiquote"), if appropriate. Should be provided in conjunction with language.

domain

as an alternative to a language and project combination, you can also provide a domain ("rationalwiki.org") to the URL constructor, allowing for the querying of non-Wikimedia MediaWiki instances.

page

the title of the page you want the links of.

protocol

limit links to those with certain link protocols. Options are listed in Special:ApiSandbox's elprotocol field.

clean_response

whether to do some basic sanitising of the resulting data structure. Set to FALSE by default.

...

further arguments to pass to httr's GET.

Examples

## Not run: 
#Links
external_links <- page_external_links("en","wikipedia", page = "Aaron Halfaker")

#Protocol-specific links
external_http_links <- page_external_links("en","wikipedia",
                                          page = "Aaron Halfaker", protocol = "http")

## End(Not run)

Ironholds/WikipediR documentation built on April 6, 2024, 8:45 p.m.