Sunday, April 26, 2009

Let Google Custom Search search in your online bookmarks

This idea has been staying in my mind for 1 year. Today I found GCS(google custom search) added a new function: Linked CSE

Linked CSE makes adding searching links open.  That is, you can have your search list outside the CSE server.  You can let CSE search in your own bookmarks!

What's the difference with traditional bookmark search:
Old bookmark search engines only record and search for page titles.  But what if we want to search the contents we bookmarked?  Or if we just forgot the title but we remember its content?  When our bookmarks are in a huge number, it's not easy to find anything we really want.

Let me show you how big different it will be.  For the first example, I bookmarked a site www.freedownloadaday.com in my Decilious bookmarks.  Using Delicious's search function I can only find this site from 3 keywords: free, download, and day.  However go to freedownloadaday's site, today's post is Clean up toolbar clutter.  I can go to my  GCS Homepage and search for "Clean up toolbar clutter".  This post is in the first result. This is what bookmark servers can't do.

You can try searching any other texts in my bookmark.

How it works
Now combining 3 main atoms by Google and Del.icio.us, I can let any online bookmark go with Google-supported context search feature.
The 3 atoms are:
  1. RSS Feed in that onlien bookmark
  2. GCS's advanced function: Linked CSE
  3. URL-based Tools for Linked CSE's

How to do
Firstly find the RSS feed of your boookmark.
My RSS feed is (default): http://feeds.delicious.com/v2/rss/migi?count=15 

Notice if we want more bookmarks to be fetched, simply change the count parameter to 999 (That's big enough I think :) -- The parameter name count varies depending on different provides.  Google Bookmarks uses num.

Log-in to your GCS website -> create/edit your engine -> In Control panel on the left, go to page Advanced. 
Locate Upload annotations, remember the bold text in that paragraph _cse_XXXXXXX
Locate Add nnotations feed, after adding a proper link in the textbox, you are done.

The GCS's URL-based tool can extract links from any web page or RSS and generate annotations(XML-based link description file for GCS).  So, we feed the RSS into the tool:
www.google.com/cse/tools/makeannotations?url=feeds.delicious.com%2Fv2%2Frss%2FMiGi%3Fcount%3D999&label=__your_label__&pattern=path
Here the parameters are:
  • url = feeds.delicious.com/v2/rss/migi?count=999 You have to encode symbols(/?=&) by yourself.  as following:
  • label = (important: You must change this value to that specified in your GCS advanced setting page.)  Find text: Label sites with _cse_XXXXXXXX if you want to include them in your Custom Search Engine
  • pattern = path
See here for more options
The encoding:

original characterescaped character
/%2F
?%3F
=%3D
&%26


More interesting CSE topic


Can I also search in my Google Bookmarks?
Yes. Use and modify this link
Unfortunately Google Bookmarks is not public, even its RSS feed.  Unless you build your own transmitter between RSS feeds and annotations with automatic logging into Google account,  you cannot have dynamic google bookmark update.

Can I search in a specific tag/label corresponding to my bookmark setting?
Technically Yes! But it needs more tune and may not be easy.  See the following relative work for the Delicious convert tool by a smart guy. (You have to provide your delicious account)

related works:
Further Reading:



No comments:

Post a Comment