Skip to content

Latest commit

 

History

History
120 lines (112 loc) · 8.32 KB

File metadata and controls

120 lines (112 loc) · 8.32 KB

MediaWiki Action API Code Samples

Code snippets in Python demonstrating how to use various modules of the MediaWiki Action API

Authentication

Accounts and users

Page Operations

Search

Basics

Demo apps

  • Article suggestion: A sample app that uses MediaWiki Action API:Search allows you to pick a category and suggest articles to write on that don't yet exist on English Wikipedia. This app uses Flask and WTForms for rendering form.
  • Nearby places viewer: Demo of geo search for wiki pages near a location using the Geolocation API and MediaWiki Action API's Geosearch module.
  • Picture of the day viewer: Demo app that uses prop=images module to fetch Wikipedia's Picture of the Day (POTD) from a template page and displays it on a webpage. The app also allows users to go backward or forward a date to view other POTD.

Installation

$ git clone https://github.com/srish/MediaWiki_Action_API_Code_Samples
$ cd MediaWiki-Action-API-Code-Samples
Install the necessary python modules with pip
$ python3 name_of_the_file.py #Enter any credentials if required in the file

Contributing code samples

First, propose an idea for a code sample, demo app, etc. by creating an issue around it in the repository. After discussing your idea with the repo contributors, start working, and then send a pull request, when you've your changes ready to be accepted/ merged! You can autogenerate python files for GET Requests demos where feasible by following the instructions below:

$ cd MediaWiki-Action-API-Code-Samples
$ Add module information to `modules.json`
$ cd python
$ python autogenerator.py
$ Make desired changes to the newly generated file(s)