Skip to content

Commit

Permalink
Add getQueryPage() method
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Aug 10, 2013
1 parent 603d843 commit cfbbe31
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ Returns entries from recent changes (starting from a given point)

Returns entries from recent changes (starting from a given point)

### client.getQueryPage(queryPage, callback)

Returns entries from [QueryPage-based special pages](http://www.mediawiki.org/wiki/API:Querypage)

### bot.upload(filename, content, summary, callback)

Uploads a given raw content as a File:[filename] - [read more](http://www.mediawiki.org/wiki/API:Upload)
Expand Down
12 changes: 12 additions & 0 deletions lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,18 @@ module.exports = (function() {
});
},

getQueryPage: function(queryPage, callback) {
// @see http://www.mediawiki.org/wiki/API:Querypage
this.api.call({
action: 'query',
list: 'querypage',
qppage: queryPage,
qplimit: 5000
}).then(function(data) {
callback && callback((data && data.data && data.data.query.querypage.results) || []);
});
},

upload: function(filename, content, summary, callback) {
var self = this;

Expand Down

0 comments on commit cfbbe31

Please sign in to comment.