Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var te = [];
- var curPage = 1;
- var nextPage = $(".pagination").children()[1];
- var topN = 30; // CHANGE THIS IF YOU WANT MORE/LESS ENTRIES
- function populateEntries() {
- nextPage = $(".pagination").children()[7];
- var entries = $("ul.ss_voting_entry_list").children();
- for (var index = 0; index < entries.length; index++) {
- var entry = $(entries[index]);
- var name = entry.find(".entry_title").find("h4").html();
- var count = entry.find(".entry_votes").find(".votes").html();
- var pic = entry.find(".entry_photo").find("li").html();
- te.push({
- 'name': name,
- 'count': count,
- 'pic': pic
- });
- }
- if (curPage < 6) {
- nextPage.click();
- curPage++;
- setTimeout(populateEntries,1000);
- } else {
- te.sort(function(a,b) {
- return b.count - a.count;
- });
- var newHTML = '<ol><div class="ss_box"><h2>';
- for (var top = 0; top < topN; top++) {
- var thisName = te[top].name;
- var thisID = thisName.substring(1,thisName.indexOf(']'));
- console.log((top+1) + ":" + thisName + ": " + te[top].count + ": " + te[top].pic );
- newHTML += "<li>" + '<a target="_blank" href="http://puzzledragonx.com/en/monster.asp?n=' + thisID + '">' + te[top].pic + "</a> #" + (top+1) + " (" + te[top].count + " votes) " + te[top].name + "</li>";
- };
- newHTML += "</h2></div></ol>";
- $('#wrapper').html(newHTML);
- $('img').css('maxWidth', 60);
- }
- }
- nextPage.click();
- setTimeout(populateEntries,1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement