The Wayback Machine - https://web.archive.org/web/20150525213202/https://github.com/greencardamom/MediaWikiAwkAPI
Skip to content
Awk library for the MediaWiki API
Awk
branch: master
Switch branches/tags
Nothing to show
Nothing to show

second

latest commit cb2050c475
greencardamom authored
Failed to load latest commit information.
LICENSE first
README.md second
backlinks.awk first
http2var.awk first
json2var.awk second
mwapiutils.awk second

README.md

MediaWiki Awk API

by User:Green Cardamom at en.wikipedia.org May 2015 (1.0) MIT license

A library of functions in GNU Awk for accessing the MediaWiki API. For building applications in Awk that use the MediaWiki API. Supports read/download API functions only, not write.

There are 3 library files and 1 example program (backlinks.awk).

Library files

http2var.awk

Networking code. Loads a web page to a string variable.

json2var.awk

Json parser. Given a json file, return a single variable with the values needed.
Depending on the API call, customize a couple lines in parse_value() to extract the 
fields you want.

mwapiutils.awk

General utility functions. 
Most with generic application, not just for MediaWiki API.

Demonstration program

backlinks.awk

This shows all the backlinks (ie. "Special:What Links Here") for a page. 
It also shows how to use the "continue" command to load > 500 items.

To run:

    awk -f backlinks.awk

A complete application, "Backlinks Watchlist" is at https://github.com/greencardamom/Backlinks-Watchlist

Something went wrong with that request. Please try again.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.