thoughton:digitallife banner
about downloads imagery work
-- How To... --

Googlescript Searches


I read a useful Google hack recently - the following link opens a Javascript window:

Javascript:void(q=prompt('Type%20in%20the%20search%20term:')); if(q)void(location.href='http://www.google.com/search?q='+escape(q))

Click the link and type in your search term. When you click 'OK' it takes you to the Google results page for your search term. What's that you say? Not very inspiring so far? Well, how about this -


Using just a little knowledge of the way Google searches you can search web directories:

Javascript:void(q=prompt('Type%20in%20the%20type%20of%20file%20here:')); if(q)void(location.href='http://www.google.com/search?client=googlet&num=100&q=intitle%3A%22index%20of%20/%22%20%22'+escape(q)+'%22')

Or you can specify a particular file type (in this case I've used .mp3, you can replace it with .ogg or .avi or whatever takes your fancy ;) ):

Javascript:void(q=prompt('Type%20the%20name%20of%20the%20MP3:')); if(q)void(location.href='http://www.google.com/search?client=googlet&num=100&q=intitle%3A%22index%20of%20/%22%20%22'+escape(q)+'%22%20mp3')

Of course, despite the title of this post, this tip isn't restricted to Google - my favorite use of this technique is the search term below which I cobbled together to enable me to quickly search this blog:

Javascript:void(q=prompt('Search%20Digital%20Life%20the%20OS%20X%20way:')); if(q)void(location.href='http://thoughton.co.uk/cgi-bin//mt-search.cgi?IncludeBlogs=1&search='+escape(q))

Note that there should be no spaces in the above code snippets.

One great use of this method is to place a button in your Bookmarks bar:
Search button


Posted on 11 January 2005, to How To... | Internet | Site News

Related entries

What's new at Google? - 15 March 2004
Failures on Google - 16 August 2005
Windows evangelist twists truth - 15 December 2004
Microsoft Zune search results - 17 September 2006
Google Maps UK updated! - 23 June 2005
Propose marriage via Search Engine - 3 October 2005
Googlemaps - 8 February 2005
Google Maps for your phone - 7 November 2005
Security Cameras on Google - 5 January 2005

Comments

There have been no comments posted to this entry.

Subscribe to comments

Enter your email address in the box below to receive an email notification whenever a new comment is posted to this entry.

Email address:

Post a comment










Remember personal info?


Click a smiley!
:) ;) 8) :| :(
:P :X :? :mad: :D
:o :cry: :shock: :blush: :roll:



Security code
Please enter this security number in the space below (this prevents automated responses).



Category icon Sponsors