EmoticonsAvatarFilter

$('').load("/wiki/Club_Penguin_Wiki:Chat_Emoticons_Reserve #mw-content-text h2 + ul", function() {
	var a = [],
		ids = [];
	$(this).find("a").each(function() {
		a.push(encodeURIComponent($(this).text()));
	});
	function get() {
		if (a.length > 0) {
			$.getJSON("/api.php?action=query&format=json&list=users&usprop=editcount&ususers=" + a.splice(0,500).join("|"), function(data) {
				for (var i in data.query.users) {
					ids.push(data.query.users[i].userid);
				}
				get();
			});
		} else {
			// start matching
			$.getJSON("/api.php?action=query&format=json&prop=revisions&rvprop=content&titles=MediaWiki:Emoticons&cb=" + new Date().getTime(), function(data) {
				for (var i in data.query.pages) {
					var m = data.query.pages[i].revisions[0]["*"].match(
						new RegExp(
							"\\*http\\:\\/\\/images\\.wikia\\.com\\/common\\/avatars\\/thumb\\/[a-z0-9]\\/[a-z0-9]{2}\\/(?:" + ids.join("|") + ")\\.png\\/60px-(?:" + ids.join("|") + ")\\.png(?:\\n\\*{2}\\([^\\n\\)]+\\))+",
							"g"
						)
					);
					console.log(m.join("\n\n"));
				}
			});
		}
	}
	get();
});