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

Content deleted Content added
mNo edit summary
mNo edit summary
Line 26:
"Category talk"
];
 
// 4. update this date-parser to match the format and language of your specific wiki. Feel free to contact Interiot regarding this, if you can't find another
// copy of this script that uses the same language.
// input: a text string from Special:Contributions. output: a javascript Date object
// documentation: http://www.quirksmode.org/js/introdate.html#parse
function date_parse(text) {
var matches = text.match(/^([0-9:]+), +([0-9]+) +([a-z]+) +([0-9]+)$/);
if (!matches) return matches;
 
parseme = matches[2] + ", " + matches[1] + " " + matches[3] + " " + matches[0] + ":00";
 
var dt = new Date();
dt.setTime( Date.parse(parseme));
 
dump_text(dt.toUTCString()); // for debugging
 
return dt;
}
 
 
Line 132 ⟶ 150:
var history_entry = new Array();
history_entry["date_text"] = history_text.match( /^<li>([^(<]+)/i )[1];
history_entry["date"] = date_parse( history_entry["date_text"] );
history_entry["title"] = history_text.match( /title="([^"]+)"/i )[1]
.replace( /&quot;/g, "\"")
Line 141 ⟶ 160:
 
//dump_lines(history_entry);
//dump_text(history_entry["date_text"]);
}
}