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, one by one using an awk script, and places them in individual files, the names of which are script parameters. Finally, it deletes the temporary file.

It 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.