How to create search engine with two parameters in Opera?
Friday, 15. February 2008, 09:13:22
Sometimes we need to specify two parameters for search as in the following search.
http://images.google.com/images?imgtype=face&q=monkey
It is possible to create search engine for the above using JavaScript.
By creating a search engine with the following JavaScript in address field, you can search Google Images from address bar by typing <search engine keyword><space><search parameter 1><space><search parameter 2> (example: gi face monkey)
javascript:var s='%s';var p=s.indexOf('+');if(p>-1){var s1=s.split('+');var s2=s.slice(p+1)};window.location.href='http://images.google.com/images?imgtype='+s1[0]+'&q='+s2;
To create search engine for another site, modify images.google.com/images?imgtype='+s1[0]+'&q='+s2; part in the above JavaScript. When you perform search, s1[0] will be replaced by first parameter & s2 with second parameter.
If <search parameter 1> is more than one word use the following JavaScript. Use dot instead of space as separtor between search parameters.
javascript:var s='%s';var p=s.indexOf('.');if(p>-1){var s1=s.split('.');var s2=s.slice(p+1)};window.location.href='http://images.google.com/images?imgtype='+s1[0]+'&q='+s2;
Update: Apr 28, 2008
I created my own custom search straight away: Google Maps Directions.
javascript:var s='%s';var p=s.indexOf('+');if(p>-1){var s1=s.split('+');var s2=s.slice(p+1)};window.location.href='http://maps.google.nl/maps?f=d&hl=en&geocode=&saddr='+s1[0]+'&daddr='+s2;By vd2k, # 16. February 2008, 11:38:57
By Tamil, # 16. February 2008, 18:06:16
I'm trying to create a search engine for Torrentz.com using your method but I can't figure out why my solution does not work.
A usual link of this search engine is:
http://torrentz.com/search?q=foo+bar
So I create this entry:
javascript:var s='%s';var p=s.indexOf('+');if(p>-1){var s1=s.split('+');var s2=s.slice(p+1)};window.location.href='http://torrentz.com/search?q='+s1[0]'+'+s2;
Looks like it doesn't accept the "+" between the two strings and I can't understand why. Any ideas?
Thanks in advance :-)
By Gesu`, # 23. February 2008, 08:29:33
Originally posted by Gesu`:
You didn't place + after s1[0]Simple & easy one
By Tamil, # 23. February 2008, 08:45:52
I suppose that the site has changed its behaviour because in the past I used the "simple solution" and it didn't work. And I'm pretty sure it was that same exact string.
Anyway, thanks again!
By Gesu`, # 23. February 2008, 15:58:02
By MAGDALENA1, # 17. April 2008, 15:58:29
By MR-NF, # 15. May 2008, 16:52:40
By Percy Shroff, # 2. July 2008, 13:21:09
By nizamx, # 4. July 2008, 16:28:37
By Tamil, # 4. July 2008, 16:38:13
I put that search field to Opera's toolbar.
By nizamx, # 4. July 2008, 17:13:19
By Tamil, # 4. July 2008, 17:19:56
By nizamx, # 4. July 2008, 17:49:21
Originally posted by nizamx:
AFAIK, not possible with search field.@Percy Shroff, AFAIK it is not possible.
By Tamil, # 4. July 2008, 17:55:05
URL=javascript:var s='%s';window.location.href='Page with %s Susbstitued by '+s+';open('Page with %s Susbstitued by '+s+'');open('Page with %s Susbstitued by '+s+'');
By Percy Shroff, # 20. July 2008, 10:53:03