Skip to content

Instantly share code, notes, and snippets.

@golles
Last active May 28, 2020 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save golles/3c65ad74a0213aeeee2ececc916aa498 to your computer and use it in GitHub Desktop.
Save golles/3c65ad74a0213aeeee2ececc916aa498 to your computer and use it in GitHub Desktop.
This bookmarklet orders turnip prices descending on turnip.exchange
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));
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