(function () { function deletepost(post) { del = document.createElement("span"); del.setAttribute("style","color: red;"); del.appendChild(document.createTextNode("SPAM")); post.parentNode.insertBefore(del, post); } var allListings = document.evaluate("//blockquote[2]/p/a", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allListings.snapshotLength; i++) { thisListing = allListings.snapshotItem(i); thisURL = thisListing.getAttribute('href'); GM_xmlhttpRequest({ method: 'GET', url: thisURL, headers: { 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey', 'Accept': 'application/atom+xml,application/xml,text/xml', }, onload: function(responseDetails) { var regex = /www\..*\.\w{2,5}\W/; if (regex.test(responseDetails.responseText)) { deletepost(thisListing) } } }); } })();