suburbia

Premshree's (品速力) Personal Weblog

etc.

Previous Entry Add to Memories Share Next Entry
Yahoo! Search link on Google
suburbia
premshree

I use Google as my primary search engine. However, nowadays, more often than not, I tend to use Yahoo! Search too. After I search using Google and I’m not satisfied with the results, mind you. So, a Greasemonkey script that does this:

Yahoo! Search link on Google

Notice the “Yahoo!” among the tabs. Simple. Useful. You may install the script from here.

Edit [11:58, 13/05/05]: One of the comments to Jeremy’s post mentions Butler—way more comprehensive, etc. I should look for stuff before I hack my own, ya know.


Does it search in Yahoo and give results using the same google page?
Wow, that seems interesting :)


Offtopic: I've added you to my friendlist, but I'm writing in russian primarily. Sorry for that :) Promise to comment in english :0)

Doesn’t give the results in the same page; however, saves a few clicks. :-)

I wish I could understand a few more non-programming languages.

sorry for earlier - works fine :)

works great! you should add "http://www.google.com/search*" to the list of @includes.

I'm not seeing that on the list:

// @include http://google.co.in/*
// @include http://www.google.co.in/*
// @include http://google.tld/*
// @include http://www.google.tld/*

but I did see (after making my post) that version 0.3.4 is supposed to see .tld as (.com|.co.uk|...). I only had v0.3.3 installed.


I don't think you need to wrap the script in an anonymous function from now on. It's done automatically for you

Backward “compatibility”. :-|

http://diveintomark.org/projects/butler/ is what put halt to my development of a similar script

Noticed it on Jeremy’s blog. Heh, I’m such a dope!

Heh, looks like even Jeremy did not know about Butler!!

BTW - anyone aspiring to write GM scripts take a look at http://diveintogreasemonkey.org/ and those who do not want GM ruining their pages look at http://dean.edwards.name/weblog/2005/03/ungreased/

And vice versa? (just in case)

// ==UserScript==
// @name Google Search link on Yahoo!
// @description adds a link to Google search on Y!
// @include http://search.yahoo.com/*
// ==/UserScript==


(function() {
if (document.getElementById("yschinfo")) {
var q = document.s.yschsp.value;
q_elem = document.getElementById("yschtg");
var y_elem = document.createElement("a");
y_elem.href = "http://www.google.com/search?q=" + q;
y_elem.innerHTML = "Google";
q_elem.insertBefore(y_elem, q_elem.childNodes[2]);
}
})();

- Shajith

Canadian version of both these scripts

(Anonymous)

2005-05-13 06:23 pm (UTC)

// ==UserScript==
// @name Yahoo Canada! Search link on Google Canada
// @description adds a link to Y! Canada search on Google Canada
// @include http://www.google.ca/*
// @include http://www.google.com/*
// ==/UserScript==

(function() {
if (document.gs) {
var q = document.gs.q.value;
var q_elem = document.getElementById("t1a");
var y_elem = document.createElement("a");
y_elem.href = "http://ca.search.yahoo.com/search?p=" + q;
y_elem.innerHTML = "Yahoo Canada!";
q_elem.parentNode.insertBefore(y_elem, q_elem);
space_elem = document.createElement("span");
space_elem.innerHTML = " ";
q_elem.parentNode.insertBefore(space_elem, q_elem);
}
})();

=BREAK==DONT INSERT THIS LINE=====THESE ARE 2 SEPERATE SCRIPTS======

// ==UserScript==
// @name Google Canada Search link on Yahoo Canada!
// @description adds a link to Google Canada search on Y! Canada
// @include http://search.yahoo.com/*
// @include http://ca.search.yahoo.com/*
// ==/UserScript==


(function() {
if (document.getElementById("yschinfo")) {
var q = document.s.yschsp.value;
q_elem = document.getElementById("yschtg");
var y_elem = document.createElement("a");
y_elem.href = "http://www.google.ca/search?q=" + q;
y_elem.innerHTML = "Google Canada";
q_elem.insertBefore(y_elem, q_elem.childNodes[2]);
}
})();


Enjoy
Memorydump

Sauce for the Google ...errr... goose... :)

(Anonymous)

2005-05-14 05:17 am (UTC)

Nice. Completes the set!

GreaseMonkey throws up an interesting issue: What if there are GM scripts that phish for information, and a user unwittingly installs an extension that acts as a phishing script? Should browsers start supporting a CRC/MD5 check logo (like the ssl lock icon) to certify that the client and server-side copies of a page are the same and unaltered? Just curious....

I’m wondering if maybe we could hack a Greasemonkey script to do that: we could check for the rendered DOM (or content) against the original.

One thing that website owners can do is to disable gm userscripts, but that’s kinda undemocratic. Supporting an (optional) check or something sounds nice, considering that it does not have to be Mozilla- (or Opera-) specific.

This thing about gm and phishing is interesting; if you find more literature, please pass it on. :-)

It's been done already!

(Anonymous)

2005-05-13 06:51 pm (UTC)

http://yagoohoogle.com/

Re: It's been done already!

premshree

2005-05-13 06:53 pm (UTC)

It _forces_ me to view results from both.

I posted your comment to the Greasemonkey mailing list. You might want to take a look at the thread. One of the interesting things that was mentioned was about Userscipt.org (not live yet) — which aims to be a repository of registered, reviewed userscripts.

http://www.customizegoogle.com/

(Anonymous)

2005-05-13 06:49 pm (UTC)

Why not just use http://www.customizegoogle.com/ ?

Re: http://www.customizegoogle.com/

premshree

2005-05-13 06:54 pm (UTC)

Because I didn’t know about it.

Re: http://www.customizegoogle.com/

premshree

2005-05-13 06:55 pm (UTC)

Moreover, I wanted what I wanted.

Re: http://www.customizegoogle.com/

(Anonymous)

2005-05-13 06:57 pm (UTC)

bet your not smart enough to hack my computer :-)

Re: http://www.customizegoogle.com/

premshree

2005-05-13 07:00 pm (UTC)

Eh?

PS: I love anonymous folks.

Good Job!

(Anonymous)

2005-05-14 06:38 am (UTC)

Indians Rocks!

Dude, you're on ZDNet!

swaroopch

2005-05-14 07:41 am (UTC)

Check it out:

http://news.com.com/2061-10811_3-5706343.html


Google and Yahoo are back together again, but not by their own design. Premshree Pillai, a 22-year-old self-described hacker from India, has written a script to insert a Yahoo tab on the Google home page with the use of dynamic HTML. That way, he can easily click to Yahoo search results (without retyping the query) when Google's listings fall short. Clever, but it won't bring smiles in the corporate camps of Yahoo and Google.


Enjoy!
Swaroop
www.swaroopch.info

Re: Dude, you're on ZDNet!

swaroopch

2005-05-14 07:42 am (UTC)

Oops, I meant CNet :-/, can you please correct that?

Swaroop
www.swaroopch.info

Re: Dude, you're on ZDNet!

(Anonymous)

2005-05-14 09:36 am (UTC)

hacker my ass

Re: Dude, you're on ZDNet!

premshree

2005-05-15 02:24 am (UTC)

Holy shit! Mark must be pretty pissed at me. ;-)

Re: Dude, you're on ZDNet!

(Anonymous)

2005-05-17 01:44 pm (UTC)

Congrats. Great script.

You are also mentioned here;

http://www.linkpopularity.ca/googlenews.asp

... and your link has been emailed to their subscriber list!

All the best.

Doug


Google on Yahoo!

(Anonymous)

2005-05-18 08:33 pm (UTC)

Hi Premshree,

Are the cease and desist e-mails from Google pouring in yet?

However, after being inspired by your script and being introduced to GreaseMonkey *just* tonight, I have hacked together a Google! on Yahoo script @ http://sarat.xcelens.co.uk/2005/05/18/google-search-link-on-yahoo/

Now only if I could build on that to allow Google and Yahoo results side by side in the same page. I have some few ideas and wondered if you were interested in a joint effort?

E-mail me at (sarat [dot] pediredla [at] xcelens [dot] co [dot] uk) if you think its worth a shot

There’s already one: http://yagoohoogle.com/. Yeah, but doesn’t use cool stuff. :-)

Re: Google on Yahoo!

(Anonymous)

2005-05-21 04:54 pm (UTC)

Like you said twingine.com or yagoohoogle.com does this but it is
not pretty or even really useful. I could tile 2 firefox windows horizontally
and get the same effect. I wanted to produce a better dynamic version of search and am working on it.

Will post a link when I finish it.

Sarat

Works on Opera

(Anonymous)

2005-05-19 04:13 am (UTC)

This'll work on Opera if you take away the .tld thing and add .com or whatever your local google is :)

A little late :)

(Anonymous)

2005-05-23 05:02 am (UTC)

But I figured, "why not do away with Yahoo Search on my.yahoo.com altogether?". I needed an excuse to experiment with GM and this was it. Thanks for the inspiration.

http://ragweed.net/firefox/MyYaGoogle.user.js

Check GrabAll.com

(Anonymous)

2005-06-08 03:41 am (UTC)

http://www.GrabAll.com does the job for you. Good luck!

Re: Check GrabAll.com

(Anonymous)

2005-07-09 05:35 am (UTC)

almost the same does http://www.dogpile.com/
...but with nicer GUI...

peace!

Yahoo's resuts are pretty differnt from google some times totally so yea it is better to check both if you didn't get satisfied results from google