Request: Remove Wikipedia Results From Yahoo Search Results
|
|
I'm sick of having Wikipedia's propaganda appear as the first link on every result from Yahoo. Can someone write a script please to remove the wikipedia results? Pretty please? P.s. Excuse the crude username. I had to borrow an account from bugmenot after not receiving an activation email subsequent to my registration. |
|
|
This'll do it; of course, it'd mean you'll be down a result or two on any pages that have wikipedia links in them... var allWiki = document.evaluate('//div[@id="main"]/div[@id="web"]/ol/li/div[@class="res"]/span[@class="url"]/b[. = "en.wikipedia.org"]',
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
for (i = allWiki.snapshotLength - 1; i >= 0; i--)
(resItem = allWiki.snapshotItem(i).parentNode.parentNode).parentNode.removeChild(resItem);
|
|
|
What exactly does |
|
|
If you perform a search on yahoo.com (eg. a search for greasemonkey), notice how the url at the bottom of each result (in green) has the host in bold. What |
|
|
znerp, Thanks, much obliged. I'm gonna give it a go. Surely specifying "search.yahoo.com" as the included page will prevent it from removing the links from any other page, so what do you mean? P.s. Can I paypal you some moola? |
|
|
EXCELLENT WORK!!! I must send you $20. Please, what is your paypal? |
|
|
Surely specifying "search.yahoo.com" as the included page will prevent it from removing the links from any other page, so what do you mean?Yeah, I'd go with http://search.yahoo.com/search* or similar for the includes.
Please, what is your paypal?You really don't need to send me anything for this; I don't do this for any money, and I'm pretty sure no one else on these forums does either. |
|
|
You really don't need to send me anything for this; I don't do this for any money, and I'm pretty sure no one else on these forums does either. Apparently, someone does:
|
|
|
Yeah, I've got a few paypal links on some of my script pages. I started removing them and apparently got distracted along the way. My point was though that it would be somewhat misdirected to aim to get some money through posting on these forums. There are a lot of active posters, some of whom put a lot more effort into writing replies to topics than I do, so I don't think it would be fair for me to take someone's money. |
|
|
Ok, thanks. So . seems equal to text()? How would I match href attributes, or src attributes? And actually use a regular expression?
|
|
|
So . seems equal to text()?I don't know much about XPath, but see here for details on what the dot refers to. How would I match href attributes, or src attributes?You can see also in the link I posted about these, eg. //a[@src="foo.jpg"].
And actually use a regular expression?I don't know about this; this is why I've not replied to the topic you created. Try googling it? |
|
|
I did, couldn't really find anything but this.
|
|
|
Znerp, I hate to bug you, But Yahoo seems to have changed something, and your script no longer works. Can you please help me? Thanks |
