iRead, iLearn, iWrite. Hence, iBlog.

For Indian Military, Nuclear & Space matters, visit:

Monday, February 27, 2012

Quick & convenient way to search any frequently looked-up website [How-To]

Each time, before uploading a new post on this blog, I usually add a URL or two of an earlier post I'd made, that could be relevant to the latest one about to be made. I find looking up a suitable post for this quite inconvenient. I could have to login to the Blogger account & look up a post, based on tags added. Too many steps involved. Google comes in handy. Using the site: search operator & my blog's domain name, I can ensure relevant result being made available to me from my blog. However, having to do it often, & it becomes quite a chore.

Thus, in order to make it quick & convenient to search this blog, I wrote this bit of bookmarklet. What it does is, by pressing on it, it opens a small dialog box, where you type in you search query. Once done, it will then open up Google's search result page in a new tab1, restricting the results obtained only from the blog. Drag it to your browser's Bookmarks toolbar.

--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------

Not just this. if you are on some other website & come across a term that you may want to search for on my blog, all you need to do is select/highlight the word with your mouse & then simply press on the bookmarklet. No need to type anything.

This can be quite easily modified to run a similar search through any other website that you may frequently search for information, without having to first visit the site to search it. Take a look at the underlying code. Copy it in either Notepad or some other editor [if Notepad, disable Word Wrap to be safe]
javascript:d=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);d=d.replace(/\r\n|\r|\n/g,"%20,");if(!d)d=prompt("Enter%20the%20words:",%20"");if(d!=null)window.open("https://www.google.com/search?q=site:AAME.IN%20"+escape(d).replace(/%20/g,"+"));void(0);




All you need to do is replace the AAME.IN in the code above with the domain name of the website you want to search. Find this very handy for searching Cryptome, a website I often dig into for information & whose interface hasn't changed since the last millennium. Needless to say, it does not have an in-built search box.

If you want to run a normal unrestricted search through Google, then the following bookmarklet can be used

--------------------------------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------------------------------

Image Search

If you wish to search for images on this blog use the following bookmarklet

--------------------------------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------------------------------

This code too can be suitably modified to search for any website of your choice

javascript:d=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);d=d.replace(/\r\n|\r|\n/g,"%20,");if(!d)d=prompt("Enter%20the%20words:",%20"");if(d!=null)window.open("https://www.google.com/search?tbm=isch&q=site:AAME.IN%20"+escape(d).replace(/%20/g,"+"));void(0);



As the previous one, replace the AAME.IN with the corresponding domain name of your choice.

The following can be used for for running a normal image search using Google.

--------------------------------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------------------------------

Video Search

The following bookmarklet enables you to search for videos on the Internet Archive

--------------------------------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------------------------------

If you want to search some other website for videos, then the following code needs to be correspondingly modified,

javascript:d=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);d=d.replace(/\r\n|\r|\n/g,"%20,");if(!d)d=prompt("Enter%20the%20words:",%20"");if(d!=null)window.open("http://www.google.com/search?tbm=vid&q=site:ARCHIVE.ORG%20"+escape(d).replace(/%20/g,"+"));void(0);



Replace ARCHIVE.ORG, in the code above, with the name of the website of your choice.

For running a normal video search through Google, the following needs to be dragged & used from the toolbar,

--------------------------------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------------------------------

These are some other bookmarklets that can perform some specific searches, as described. They too can be invoked by highlighting a term on any webpage, & then pressing on the bookmarklet.

BookmarkletDescription
Google News
Search any query using Google News Service
Google Shopping
Search Google Shopping
Google Books
Search Google Books
Blog Search
Search through blogs
App search
Search for apps
Patent Search
Search through patents

Godspeed

1 - this action could be browser-dependant. Using & testing it on Firefox & it works by opening a new tab.