Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //run script at: http://www.nexusmods.com/games/mods/completehistory/
- //1) paste this script in your browser console and press ENTER, READ:
- //2) this will endorse all mods on the current mod history page that are not yet endorsed or abstained
- //3) the process is automatic, if you get alert windows, just hide them and refresh the page
- //4) popups are closed automatically (not done by script, must be a side effect)
- //5) if the html changes, or nexus adjusts their way of handling endorsements, this script will break
- //USE AT YOUR OWN RISK!
- //USE AT YOUR OWN RISK!
- //USE AT YOUR OWN RISK!
- $(function() {
- //Nexus uses a special kind of ID/hash/whatever as params to the endorse function, let's find them!
- var firstEndorseFunctionCall = $("span.file-rating a[onclick]:first").attr("onclick");
- var endorseFunctionId = firstEndorseFunctionCall.split(',')[1];
- var endorseFunctionId2 = firstEndorseFunctionCall.split(',')[2].split("_")[3].slice(0, -1);
- console.log("endorseFunctionId: " + endorseFunctionId);
- console.log("endorseFunctionId2: " + endorseFunctionId2);
- //grab a list of all mod links on the current page (http://www.nexusmods.com/games/mods/completehistory/?page=X)
- var thumbsUp = "https://staticdelivery.nexusmods.com/contents/images/icons/thumb_up.png";
- var modIds = [];
- var modLinks = $("div#left-col").find("span.file-name a").map(function() {
- return this.href;
- }).get();
- //iterate through the result and parse the mod IDs
- for(var i = 0; i < modLinks.length; i++) {
- var id = modLinks[i].split('/')[5]; //5x '/' so we need idx number 5.
- var selector = "img[id^=\"img_end_"+ id +"\"]";
- if($(selector).length && $(selector).attr("src") === thumbsUp) { //make sure that the mod isn't already endorsed or abstained
- modIds.push(id);
- }
- }
- //start mass endorse!
- for(var i = 0; i < modIds.length; i++) {
- console.log("Endorsing mod " + modIds[i] + ".");
- endorse_mod(modIds[i],endorseFunctionId,'img_end_'+ modIds[i] +'_' + endorseFunctionId2, endorseFunctionId2, false, 0, 1, 'h2');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement