Learn R Programming

WikipediaR (version 1.1)

contribs: lists contributions of a specific wikipedia page

Description

provide the list of the contributions of a wikipedia page: discussions for Talk pages, or revisions for Subject pages.

Usage

contribs(page = NULL, domain = "en", rvprop = "user|userid|timestamp")

Arguments

page
numeric identifier or character title of the specific wikipedia page
domain
a character value specifying the language of the wikipedia page.The default value is "en" for "english language".
rvprop
Which properties to get for each revision (separate with '|'):
  • ids: the ID of the revision
  • flags: revision flags (minor)
  • timestamp: the timestamp of the revision, i.e. day and time
  • user: user that made the revision
  • userid: user id of revision creator
  • size: length (bytes) of the revision
  • sha1: SHA-1 (base 16) of the revision
  • contentmodel: content model id
  • comment: comment by the user for revision
  • parsedcomment: parsed comment by the user for the revision
  • content: text of the revision
  • tags: tags for the revision

Default: user|userid|timestamp

Value

an object of class contribsClass:
  • call the command line
  • page title and identification number of the Wikipedia page
  • contribs a data frame containing asked properties of the contribs, by default : user, userid, timestamp. If the user does not exist or has no contribution, this item is not created.
  • testWikiPage a list of four elements,
    • takeOnlyFirst a boolean indicating if the class of page parameter is invalid, for example vector, list, matrix..., and in that case, only the first element is considered.
    • redirPage title of the redirected page. This item is NULL if the page is not redirected.
    • test an integer with value:
      • 4 for invalid domain,
      • 3 for an empty parameter page,
      • 2 when Wikipedia does not have an article with this exact name,
      • 1 for ambiguous page, direct or redirect,
      • 0 for valid an unambiguous page, direct or redirect.
    • warnMessage is a vector of warning messages.

Details

This function uses the API query syntax: "prop=revisions". For more details, see https://www.mediawiki.org/wiki/API:Backlinks If the page is ambiguous, the contributions correspond to the modification on this ambiguous page, not on the possible linked pages. If the user is anonymous, the user in the output corresponds to the IP address, and the userid is zero.

See Also

print.contribsClass userInfo

Examples

Run this code
## Not run: 
# ## numeric page identifier as parameter
# contribs(domain = "fr", page = 108907)
# 
# ## title page as parameter
# contribs(domain ="en", page = "Wikipedia")
# ## End(Not run)

Run the code above in your browser using DataLab