Learn R Programming

WikipediR

An R API wrapper for MediaWiki, optimised for the Wikimedia Foundation MediaWiki instances, such as Wikipedia.

Author: Os Keyes License: MIT Status: Stable

Description

WikipediR is a wrapper around the MediaWiki API, optimised for the Wikimedia Foundation's production sites, such as Wikipedia. It is written in and for R, a statistical environment and associated programming language in heavy use by HCI researchers that, somehow, escaped having an API wrapper until now.

Installation

For the most recent version, on CRAN:

install.packages("WikipediR")

For the development version:

library(devtools)
devtools::install_github("ironholds/WikipediR")

Limitations

WikipediR currently lacks:

  • Quite a few possible API calls;
  • Direct authentication, through MediaWiki or OAuth.

These issues will be solved in time; if there is a particular feature you want, open an issue here on github: I can't prioritise if I don't know what people are trying to do :).

Dependencies

  • R. Doy.
  • httr and its dependencies.

Copy Link

Version

Install

install.packages('WikipediR')

Monthly Downloads

4,585

Version

1.7.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

April 5th, 2024

Functions in WikipediR (1.7.1)

user_information

Retrieve user information
user_contributions

Retrieve user contributions
login

wikimedia api user login
page_content

Retrieves MediaWiki page content
get_action_token

request token for api action as signed in user
create_page

wikimedia api page creation (single pages) helper function to do the actual api requests for page and category-page creation
page_external_links

Retrieve a page's links
WikipediR

A client library for MediaWiki's API
get_prelogin_token

request token to start client login
page_backlinks

Retrieve a page's backlinks
create_pages

wikimedia api page creation Create pages or category-pages on a wikimedia instance.
categories_in_page

Retrieves categories associated with a page.
revision_diff

Generates a "diff" between a pair of revisions
page_info

Retrieve information about a particular page
query

base query function
recent_changes

Retrieves entries from the RecentChanges feed
random_page

Retrieve the page content of a random MediaWiki page
parse_response

parse_response: Parse WikipediR responses internally
revision_content

Retrieves MediaWiki revisions
pages_in_category

Retrieves a list of category members.
page_links

Retrieve a page's links