Skip to content

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

License

Notifications You must be signed in to change notification settings

martyav/MediaWiki-Action-API-Code-Samples

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.7%
  • HTML 10.6%
  • CSS 5.4%
  • JavaScript 3.3%