MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "Scripts:Installer_ePSXe_1.52-alpha",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "1009": {
                "pageid": 1009,
                "ns": 0,
                "title": "Sandbox",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "{{Infobox\n|title        = ETCwiki.org Infobox\n|image        = [[Image:example.png|200px]]\n|header1 = Main Heading\n|header2 = First set of data\n|label2  = Label\n|data2   = Data\n|header3 = Remove this line (optional)\n|label3  = More Label\n|data3   = More data\n}}"
                    }
                ]
            },
            "351": {
                "pageid": 351,
                "ns": 0,
                "title": "Scripts:GoodRenamer",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "== About ==\nThis script will take a goodhave.txt file and directory as input, scan the file renaming all files or *.<ext> which match the NAME.<ext> result to GOODNAME.<ext> when NAME was a partial match for GOODNAME\n\nThe script itself is very much in an alpha state, use at your own risk. The script will run over a single directory (it does not recurse directories).\n\n== Usage ==\n# Save the script below to <filename>.py\n# Have a directory of *.ext filenames\n# Have a goodhave.txt file available*\n# Run the script with ''python <scriptname> <goodhave file> <working path> <file extension>''\n\n<nowiki>*</nowiki> ''If you do not have a goodhave file available, you can redirect the output of the '''ls''' command to a file; then use the new file as input.''\n\n== Batch Example ==\n=== Linux ===\nTo run this script as a batch process you could attach the script to a find command, use at your own risk\n\n'''find . -type d -exec''' ''python <scriptname> <goodhave file> {} <file extension>'' '''\\;'''\n\n== Output Example ==\n<pre>\nCopying Atari Jaguar/CRC_Snaps/I-War (UE).png to Atari Jaguar/CRC_Snaps/I-War (1995).png\nCopying Atari Jaguar/CRC_Snaps/Theme Park (UE).png to Atari Jaguar/CRC_Snaps/Theme Park (1995) (Ocean).png\nCopying Atari Jaguar/CRC_Snaps/Iron Soldier (UE) (v1.04).png to Atari Jaguar/CRC_Snaps/Iron Soldier (1994) [a1].png\nCopying Atari Jaguar/CRC_Snaps/Iron Soldier (UE) (v1.04).png to Atari Jaguar/CRC_Snaps/Iron Soldier (1994).png\nCopying Atari Jaguar/CRC_Snaps/Super Burnout (UE).png to Atari Jaguar/CRC_Snaps/Super Burnout (1995).png\nCopying Atari Jaguar/CRC_Snaps/Cannon Fodder (UE).png to Atari Jaguar/CRC_Snaps/Cannon Fodder (1995) (Computer West).png\nCopying Atari Jaguar/CRC_Snaps/Checkered Flag (UE).png to Atari Jaguar/CRC_Snaps/Checkered Flag (1994).png\n</pre>\n\n== Python Script ==\n<pre>\n#!/usr/bin/python\n# -*- coding=iso-8859-15 -*-\n\n# Rename files to goodnames\n\nimport os\nimport sys\nimport re\nimport shutil\n\nfor arg in sys.argv:\n    if len(sys.argv[1:]) == 3:\n        wrkfile = sys.argv[1]\n        wrkdir = sys.argv[2]\n        wrkext = sys.argv[3]\n        if not os.path.exists(wrkfile) and os.path.isfile(wrkfile):\n            print wrkdir + \" not found\"\n            exit(0)\n        if not os.path.exists(wrkdir) and os.path.isdir(wrkdir):\n            print wrkdir + \" not found\"\n            exit(0)\n        if len(wrkext) < 1:\n            print \"File extension error\"\n            exit(0)\n    else:\n        print \"Usage: \" + sys.argv[0] + \" <goodhave file> <working path> <file extension>\"\n        print \" Example: \"  + sys.argv[0] + \" \" + chr(34) + \"5200Have.txt\" + chr(34) + \" \" + chr(34) + \"Atari 5200/CRC_Snaps/\" + chr(34) + \" \" + chr(34) + \"png\" + chr(34)\n        exit(0) \n\nfiles = os.listdir(wrkdir)\nfor file in files:\n    mfile = re.match('^[\\w\\s\\-\\!]*',file)\n    with open(wrkfile) as ifile:\n        for record in ifile:\n            mrecord = re.match('^[\\w\\s\\-\\!]*',record)\n            if mrecord is not None:\n                if mfile.group(0) == mrecord.group(0):\n                    srcfile = str(wrkdir) + str(file)\n                    destfile = str(wrkdir) + str(record.rstrip(' ').rstrip('\\r\\n')) + \".\" + str(wrkext)\n                    if not os.path.exists(destfile):\n                        print \"Copying \" + srcfile + \" to \" + destfile\n                        shutil.copy2(srcfile, destfile)  \n                    else:\n                        print srcfile + \" exists\"          \n</pre>"
                    }
                ]
            }
        }
    }
}