Learn R Programming

WikipediaR (version 1.1)

userContribs: lists contributions for a specific user

Description

lists contributions for a specific user: discussions for Talk pages, and revisions for Subject pages.

Usage

userContribs(user.name = NULL, domain = "en", ucprop = "ids|title|timestamp|comment|sizediff|flags")

Arguments

user.name
a character value providing the name of the user
domain
a character value providing the language of the wikipedia page. The default value is "en" for "english language".
ucprop
Include informations (separate with '|') :
  • ids the page ID and revision ID
  • title the title and namespace ID of the page. This parameter is not optional.
  • timestamp the timestamp of the edit, i.e. day and time
  • comment the comment of the edit
  • parsedcomment the parsed comment of the edit
  • size the new size of the edit
  • sizediff the size delta of the edit against its parent
  • flags flags of the edit
  • patrolled patrolled edits
  • tags tags for the edit

Default: ids|title|timestamp|comment|sizediff|flags

Value

an object of class userContribsClass:
  • call the command line
  • user a vector containing the user name and the user identifier
  • contribs a data frame containing the asked properties of the revisions. If ids is asked, the corresponding results are pageid, revid, and parentid. Three others informations are automatically added : ns, numbers of the namespaces (identification of the type of pages, defining nscat et nssubj, the two next variables), nscat, the categories of linked pages (Subject, Talk, or Virtual), nssubj, the subjects of the linked pages (Main Article, User, Wikipedia, File, MediaWiki, Template, Help, Category, Protal, Book, Draft, Education Program, TimedText, Module, Topic, Special, Media, Other) . This item is provided if the user has at least one contribution. For more details about namespace, see http://www.mediawiki.org/wiki/Help:Namespaces and http://en.wikipedia.org/wiki/Wikipedia:Namespace#Subject_namespaces
  • testWikiUser A list of three elements. The first is takeOnlyFirst, a boolean indicating if the class of user.name parameter is invalid, for example vector, list, matrix..., and in that case, the only the first element is considered. The second element is test, an integer with value:
    • 4 for invalid domain,
    • 3 for an empty parameter user,
    • 2 when Wikipedia does not have an user with this exact name,
    • 0 for valid existing user.
    The last element, warnMessage, is a vector of warning messages.

Details

This function uses the API query syntax: "list=usercontribs". For more details, see https://www.mediawiki.org/wiki/API:Usercontribs Additionnally to the titles of the modified pages, this function always returns in the contribs item the ns for namespace (identifcation of the type of pages), the nscat for the category of the pages (Subject, Talk, or Virtual), and the subject of the pages.

See Also

userInfo

Examples

Run this code
## Not run: 
# LouiseContribs <- userContribs(user.name = "Louise", domain = "en")
# ## try a user that does not exist (at the moment of the redaction of this help page)
# userContribs(user.name="Louise Baschet", domain ="fr")
# ## End(Not run)

Run the code above in your browser using DataLab