User:Interiot/Tool2/code.js: Difference between revisions

Content deleted Content added
mNo edit summary
mNo edit summary
Line 1:
// see http://en.wikipediapaperlined.org/wikiapps/User:Interiotwikipedia/Tool2/ for instructions on adding this to your monobook.js
 
// To run this tool on other servers:
Line 89:
if (request.status == 200) {
page_list.push(request.responseText);
//dump_text(request.responseText);
 
// see if there's another pageful to get
Line 95:
return p.match( /(\d+)$/ )[0];
}, request.responseText.match( offset_regexp ) );
//while ((matches = offset_regexp.exec(request.responseText)) != null) {
dump_lines(matches);
for (var i=0; i<matches.length; i++) {
//dump_lines(matches);
//var v = matches[1] * 1;
var v = matches[i] * 1;
if (v != 0 && (offset == 0 || v < offset)) {
Line 111 ⟶ 107:
parse_data(page_list, handler);
} else {
//alert("fetching another page starting at offset " + next_offset);
// tail recurse
fetch_data(username, end_date, handler, next_offset, page_list);
Line 120 ⟶ 115:
 
function parse_data(page_list, handler) {
//var total_len = 0;
//for (var i=0; i<page_list.length; i++) total_len += page_list[i].length;
total_len //alert("parsing " += page_list[i].length + " pages comprising " + total_len + " total bytes");
alert("parsing " + page_list.length + " pages comprising " + total_len + " total bytes");
}
 
 
 
// ===================================== test/debug functions =========================================
 
function dump_text(text) {