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": "Reflect_images",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> 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": {
            "214": {
                "pageid": 214,
                "ns": 0,
                "title": "Real-time graphing",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "<html>\n  <script type=\"text/javascript\" src=\"https://jsxgraph.uni-bayreuth.de/distrib/prototype.js\"></script>\n  <style>\n    #jxgbox {\n       background-color:black;\n    }\n  </style>\n</html>\nThis little script shows how to graph the data from a sensor in a web browser.\nUsing AJAX, the web browser retrieves once per second data from the web server by calling the script ''fakesensor.php''.\n\nBeware that in order to simplify the handling of AJAX we use the additional library [http://www.prototypejs.org/ prototype.js] in this example.\n\nHere, ''fakesensor.php'' just returns a random number, but one can image that real sensor data can be accessed similarly.\n<jsxgraph width=\"647\" height=\"400\">\nvar brd, g, \n    xdata = [], ydata = [],\n    turt,i;\n\nbrd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[0,20,30,-2]});\n\n// Draw the additional lines\nturt = brd.create('turtle',[],{strokecolor:'#999999'});\nturt.hideTurtle().right(90);\nfor (i=5;i<=15;i+=5) {\n    turt.penUp().moveTo([0,i]).penDown().forward(30);\n}\n\nfetchData = function() {\n    new Ajax.Request('/ajax/fakesensor.php', {\n        onComplete: function(transport) {\n            var t, a;\n            if (200 == transport.status) {\n                t = transport.responseText;\n                a = parseFloat(t);\n                if (xdata.length<30) {\n                    xdata.push(xdata.length);\n                } else {\n                    ydata.splice(0,1);\n                }\n                ydata.push(a);\n                if (!g) {                   // If the curve does not exist yet, create it.\n                    g = brd.create('curve', [xdata,ydata],{strokeWidth:3, strokeColor:'yellow'}); \n                } \n                brd.update();\n            };\n    }});\n};\nsetInterval(fetchData,1000);  // Start the periodical update\n</jsxgraph>\n\n===The underlying JavaScript code===\n<source lang=\"html4strict\">\n  <script type=\"text/javascript\" src=\"http://jsxgraph.uni-bayreuth.de/distrib/prototype.js\"></script>\n  <style>\n    #jxgbox {\n       background-color:black;\n    }\n  </style>\n</source>\n\n<source lang=\"javascript\">\nvar brd, g, \n    xdata = [], ydata = [],\n    turt,i;\n\nbrd = JXG.JSXGraph.initBoard('jxgbox', {axis:true, boundingbox:[0,20,30,-2]});\n\n// Draw the additional lines\nturt = brd.create('turtle',[],{strokecolor:'#999999'});\nturt.hideTurtle().right(90);\nfor (i=5;i<=15;i+=5) {\n    turt.penUp().moveTo([0,i]).penDown().forward(30);\n}\n\n\nfetchData = function() {\n    new Ajax.Request('/ajax/fakesensor.php', {\n        onComplete: function(transport) {\n            var t, a;\n            if (200 == transport.status) {\n                t = transport.responseText;\n                a = parseFloat(t);\n                if (xdata.length<30) {          \n                    xdata.push(xdata.length); // add data to the x-coordinates, if the right border has not been reached, yet\n                } else {\n                    ydata.splice(0,1);        // remove the oldest entry of the y-coordinates, to make the graph move.\n                }\n                ydata.push(a);\n                if (!g) {                   // If the curve does not exist yet, create it.\n                    g = brd.create('curve', [xdata,ydata],{strokeWidth:3, strokeColor:'yellow'}); \n                } \n                brd.update();\n            };\n    }});\n};\nsetInterval(fetchData,1000);  // Start the periodical update\n</source>\n===The PHP code of fakesensor.php===\n<source lang=\"php\">\n<?php\n   echo mt_rand(0,20);\n?>\n</source>\n\n[[Category:Examples]]\n[[Category:Charts]]"
                    }
                ]
            },
            "429": {
                "pageid": 429,
                "ns": 0,
                "title": "Rectangles",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "<jsxgraph width=\"300\" height=\"300\" box=\"box1\">\n(function() {\nvar b1 = JXG.JSXGraph.initBoard('box1', {boundingbox: [-5, 5, 5, -5], grid:true});\nvar p1 = b1.create('point', [-2,-2]),\n    p2 = b1.create('point', [3,3]),\n    p3 = b1.create('point', [function(){return p1.X()},function(){return p2.Y()}], {color:'blue'}),\n    p4 = b1.create('point', [function(){return p2.X()},function(){return p1.Y()}], {color:'blue'}),\n    rect = b1.create('polygon',[p1,p3,p2,p4],{hasInnerPoints:true});\n\np3.isDraggable = true;\np4.isDraggable = true;\n})();\n</jsxgraph>\n\n\n<jsxgraph width=\"300\" height=\"300\" box=\"box2\">\n(function() {\nvar b2 = JXG.JSXGraph.initBoard('box2', {boundingbox: [-5, 5, 5, -5], grid:true});\nvar p1 = b2.create('point', [-2,-2]),\n    p2 = b2.create('point', [3,3]),\n    pm = b2.create('midpoint', [p1, p2], {visible: false}),\n    circ = b2.create('circle', [pm, p1], {visible: false}),\n    p3 = b2.create('glider', [-2, 3, circ], {color:'green'}),\n    t = b2.create('transform', [Math.PI, pm], {type: 'rotate'}),\n    p4 = b2.create('point', [p3, t], {color:'blue'}),\n    rect = b2.create('polygon',[p1,p3,p2,p4],{hasInnerPoints:false});\n})();\n</jsxgraph>\n\n\n\n[[Category:Examples]]"
                    }
                ]
            }
        }
    }
}