My idea is posted on Digg

0 comments

Google Search In My Online Bookmarks - Simply 1 Step

software.migichen.net — Using Google Custom Search is not a news, but it is how to make it as simple as only one step to combine it with your online bookmarks. Even a non-programmer can do it. This article tells you why you may need to Google search in your bookmarks, and how to do it.

Added: Pattern option 增加 Pattern選項

0 comments

Let Google Search In My Online Bookmarks - Simply 1 Step: Now there are more search options
  1. path: Google processes your links smartly, and the sites under this link is searched.
    • For example, www.cnn.com/ or software.migichen.net/webtools/index.html will be regarded as www.cnn.com/* or software.migichen.net/webtools/*. The benifit of this is, all the related pages can be searched.(Google's description)
    • Besides, the exact link as in the bookmarks are firstly shown if it is in the search result. (I added: bootexact=1)
  2. exact: Google will not process the links. Just search in the exact links of the bookmarks. You may need it if you just want to find the exact page you had ever seen.

簡單一步讓 Google 只搜尋我的網路書籤連結內容: 現在有更多Search選擇
  1. 使用path找相關網頁:若選擇這項,Google在讀取你的 RSS 時,會很聰明的對網址作處理:搜尋網址以下的所有網頁。
    • 譬如 www.cnn.com/software.migichen.net/webtools/index.html,他會自動把名稱改為 www.cnn.com/*software.migichen.net/webtools/*,如此的好處是,這整個網址的相關網頁都會搜尋到。(Google的說明)
    • 此外 Google 會在找到的結果中,把與列表中完全相同的網址名稱優先列出。(指令:bootexact=1)
  2. exact - 只找完全相符的網頁:這就不用說了,Google 不會對RSS內容的網址做處理。這個選擇的好處是,你就是要找到之前看過的某一個網頁。

Language Auto Detector works with lang attribute自動語言選擇--現在直接使用 lang="zh" 即可

0 comments

This is English in <span lang="en">
這是<span lang="zh">下看到的中文




Using this format is much easier than using the class attribute when posting articles.
PS. Note that the post title can also include span tag!! It changes as you change the language setting!!


這樣撰寫文章還是比較方便。原理是由 javascripti 搜索 span 及 div tag,再增加對應語言的 className。也就是說,就方法 class="lang_zh" 還是有效。

要注意的是為了不要讓瀏覽器 loading 太重,搜尋tag只含 div 和 span,也就是說,如果要在其他tag內有語言自動選擇功能,還是要乖乖寫 class="lang_zh"...不過這狀況總是沒有使用 span 的來得多。
PS. 連標題都可以寫span tag!! bogger真是太寬鬆了!

code:

// for IE6 or before: change &ltspan lang="en"> to &ltspan class="lang_en">
modList = document.getElementsByTagName("span");
for (var i=0; i<modList.length; i+=1) {lang2class(modList[i]);}
modList = document.getElementsByTagName("div");
for (var i=0; i<modList.length; i+=1) {lang2class(modList[i]);}


function lang2class(elm)
{
if (attr=elm.getAttribute("lang")) {elm.className+=" lang_"+attr;}
}

Let Google Custom Search engine search in your online bookmarks

0 comments

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: