Last active
May 28, 2020 16:00
-
-
Save golles/3c65ad74a0213aeeee2ececc916aa498 to your computer and use it in GitHub Desktop.
This bookmarklet orders turnip prices descending on turnip.exchange
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:void((function(doc) { if(typeof jQuery == "undefined") { var script_jQuery = document.createElement("script"); script_jQuery.setAttribute("src", "//code.jquery.com/jquery-latest.min.js"); document.body.appendChild(script_jQuery); } setTimeout(function() { var allNodes = jQuery("div.note"); var parent = allNodes.first().parent(); parent.empty(); var orderedNodes = allNodes.sort(function (a, b) { return $(b).find("p.ml-2").text().split(" ")[0] - $(a).find("p.ml-2").text().split(" ")[0]; }); parent.html(orderedNodes); }, 1000); })(document)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: | |
void((function(doc) { | |
if(typeof jQuery == "undefined") { | |
var script_jQuery = document.createElement("script"); | |
script_jQuery.setAttribute("src", "//code.jquery.com/jquery-latest.min.js"); | |
document.body.appendChild(script_jQuery); | |
} | |
setTimeout(function() { | |
var allNodes = jQuery("div.note"); | |
var parent = allNodes.first().parent(); | |
parent.empty(); | |
var orderedNodes = allNodes.sort(function (a, b) { | |
return $(b).find("p.ml-2").text().split(" ")[0] - $(a).find("p.ml-2").text().split(" ")[0]; | |
}); | |
parent.html(orderedNodes); | |
}, 1000); | |
})(document)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment