Learn R Programming

WikipediR (version 1.7.1)

revision_content: Retrieves MediaWiki revisions

Description

Retrieves the content of a provided list of revisions from whichever MediaWiki instance you're querying. Returns as wikimarkup.

Usage

revision_content(
  language = NULL,
  project = NULL,
  domain = NULL,
  revisions,
  properties = c("content", "ids", "flags", "timestamp", "user", "userid", "size",
    "sha1", "contentmodel", "comment", "parsedcomment", "tags"),
  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.

revisions

The revision IDs of each desired revision.

properties

Properties you're trying to retrieve about that revision, should you want to; options include "ids" (the revision ID of the revision...which is pointless), "flags" (whether the revision was 'minor' or not), "timestamp" (the timestamp of the revision), "user" (the username of the person who made that revision), "userid" (the userID of the person who made the revision), "size" (the size, in uncompressed bytes, of the revision), "sha1" (the SHA-1 hash of the revision text), "contentmodel" (the content model of the page, usually "wikitext"), "comment" (the revision summary associated with the revision), "parsedcomment" (the same, but parsed, generating HTML from any wikitext in that comment), "tags" (any tags associated with the revision) and "flagged" (the revision's status under Flagged Revisions).

clean_response

whether to do some basic sanitising of the resulting data structure.

...

further arguments to pass to httr's GET.

See Also

revision_diff for diffs between revisions, and page_content for the content a specific page currently has.

Examples

Run this code
if (FALSE) {
#Revision content from a Wikimedia project
wp_content <- revision_content("en","wikipedia", revisions = 552373187)

#Revision content from a non-Wikimedia project
rw_content <- revision_content(domain = "rationalwiki.org", revisions = 88616)
}

Run the code above in your browser using DataLab