Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var r1 = /(\$|£|)\d+(k|K)/m
var r2 = /\d+-\d+(k|K)/m
var r3 = /\d+(k|K)\s?(|EUR)/m
var candidates = [r1, r2, r3];
var linkQueue = []
var comments = document.getElementsByTagName("tr")
for (var i in comments) {
var comment = comments[i];
if (comment.className && comment.className.indexOf("athing comtr") != -1) {
for (var j in candidates) {
if (comment.innerHTML.search(candidates[j]) != -1) {
var linkElements = comment.getElementsByTagName("a");
for (var k in linkElements) {
var link = linkElements[k]
if (link.id && link.id.startsWith("up_") && (!link.className || (link.className && link.className != "nosee"))) {
linkQueue.push(link);
}
}
}
}
}
}
var identifier = setInterval(function() {
var link = linkQueue.pop();
if (link) {
link.click();
console.log(link);
} else {
clearInterval(identifier);
}
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.