User:Purodha/Downloading Extensions from the MediaWiki Wiki

Several small MediaWiki extensions are distributed as source code within [ this wiki]. If you need a lot of these, you may want to automatize copying them. This depends on your operating system.

Linux, MacOs X, OpenBSD, Solaris, Unix, and similar
Here is a shell script that downloads an article from here to a temporary file. It then extracts code sections between  and   one by one, using an awk script, placing them into individual files, the names of which are script parameters. Finally, it deletes the temporary file.

This script takes two or more parameters:
 * 1) The page name where the extension is located in this wiki, without the "Extension:" name space prefix.
 * 2) A file where to store the 1st source segment. It the file existst, it is overwritten without warning. The directory, if any, of the file must already exist. Use /dev/null so as to skip this source segment.
 * 3) (optional) file where 2nd source segment is to be stored. Everything else resembles previous parameter.
 * 4) (optional) file where to store the 3rd source segment of the article.
 * 5) etc.

Feel free to enhance the code above.

Examples of use
Assuming, you have saved the above file to your local host as  and made it executable. If you wanted to download the Extensions PSINoTocNum, MagicNumberedHeadings, and Pdf_Export, you would use something like these commands: