Browse files

Broken

  • Loading branch information...
1 parent c0ed10a commit d4ebc8444fa9430868d507ea79e76deb275df6d4 Daniel Park committed Oct 5, 2012
Showing with 0 additions and 65 deletions.
  1. +0 −65 mediawikiapi/mediawikiapi.test.recentchanges.xml
View
65 mediawikiapi/mediawikiapi.test.recentchanges.xml
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
- <meta>
- <author>Mike Dillon</author>
- <sampleQuery>select * from {table}</sampleQuery>
- <!--<documentationURL></documentationURL>-->
- </meta>
- <bindings>
- <select itemPath="data.rc" produces="XML">
- <urls>
- <url>http://en.wikipedia.org/w/api.php?action=query&amp;format=xml&amp;list=recentchanges&amp;rcprop=title|timestamp|ids|comment|flags|sizes|redirect|user</url>
- </urls>
- <paging model="offset">
- <start default="0" id="dummy"/>
- <pagesize max="30" id="_rclimit"/>
- <total default="10"/>
- </paging>
- <inputs>
- <key id="ns" type="xs:integer" paramType="variable" batchable="true"/>
- <key id="_rclimit" type="xs:integer" paramType="variable" private="true"/>
- </inputs>
- <execute><![CDATA[
- if (typeof(rcstart) != 'undefined') {
- y.log("Restoring rcstart=" + rcstart);
- request.query('rcstart', rcstart);
- }
-
- delete request.queryParams['_rclimit'];
-
- y.log('dummy='+dummy+', _rclimit='+_rclimit);
-
- if (ns) {
- var namespaces = ns.join ? ns : [ ns ];
- request.query('rcnamespace', namespaces.join('|'));
- }
-
- var data = <data/>;
-
- var batch_size = 15;
- var to_fetch = _rclimit;
- while (to_fetch > 0) {
- request.query('rclimit', Math.min(to_fetch, batch_size));
-
- var rsp = request.get().response;
- var changes = y.xpath(rsp, '/api/query/recentchanges/rc');
- data.data += changes;
-
- rcstart = y.xpath(rsp, '/api/query-continue/recentchanges/@rcstart');
- if (!rcstart) {
- break;
- }
-
- to_fetch -= changes.length();
-
- if (to_fetch > 0) {
- y.log('Fetching additional data from rcstart=' + rcstart);
- request.query('rcstart', rcstart);
- }
- }
-
- response.object = data;
- ]]></execute>
- </select>
- </bindings>
-</table>

0 comments on commit d4ebc84

Please sign in to comment.