Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var qpoffset = 0;
- while ( qpoffset !== -1 ) {
- $.ajax( {
- url: 'http://ddowiki.com/api.php?action=query&format=json&list=querypage&qplimit=max&qpoffset=' + qpoffset + '&qppage=' + encodeURIComponent( qppage ),
- dataType: 'json',
- async: false,//* REALLY DON'T LIKE THIS!!! IT WILL FAIL IN THE FUTURE!!! */
- success: function ( successData ) {
- if ( successData[ 'query-continue' ] !== undefined ){
- qpoffset = successData['query-continue'].querypage.qpoffset;
- } else {
- var membersInGroup = qpoffset + successData.query.querypage.results.length;
- qpoffset = -1;
- $( 'a[title="Special:' + title + '"]' ).after( ' (' + membersInGroup.toLocaleString() + ')' );
- }
- },
- fail: function ( failureData ) {
- alert( 'Sorry, failed to retrieve page counts for workable pages.\nPlease check the console for more details if available.' );
- console.error( '%O', failureData );
- }
- } );
- }
Add Comment
Please, Sign In to add comment