Blogger: Welcome Widget (Re-Search)

google buzz

On some internet sites, you may be greeted with a message like this:

You searched google for "Blogger Welcome Widget." On our site there are 500 articles corresponding to that query.
I wanted something like this for this site. In this article I present a simple bloger widget that presents a short greeting message containing query and number of search results. Clicking on the message triggers a blogger search in your blog for the query.

I extended this widget to include welcome messages to visitors coming from Entrecard and Twitter. Please see my Greeting Widget for Entrecard and Twitter.

It is fairly easy to extract information about referrer and queries using javascript. I found a search query parser at transarte.net and only changed it slightly so that only a message appears if the search comes from outside (ignoring, say, searches from the blogger navbar or a google widget).
 
Using google's ajax.api search queries can be executed and parsed. I used the simplest form so no new javascript libraries have to be loaded.
 
The query plus number of search results are a hyperlink so that clicking on the message triggers a google search in your blog for the query.
 
If you want the fast installation, just press the widget install button to get it. Make sure you edit the information about your website (address and name of your website). Put the widget where you want it.
 

 
There is one line in the code which checks whether the referral is your own site. You will have to change that line. Just search for myoutsourcedbrain and replace with some adequate string contained in your page URL.
 
It should be fairly easy to customize the message and its look. Enjoy!

4 Responses to "Blogger: Welcome Widget (Re-Search)"

It'd be cool to add this welcome words to greet my readers. Very worth trying, thanks!

@Online Dating Tips: With the "add to blogger" button it should be easy to install it. You just need to change the text.

Thank you very much friend for this widget. I bookmarked your site. Thank you.:)

@Robinhood Softwares: You're welcome! I am glad this is useful.

  Subscribe to replies to this post

 
This conversation is missing your voice. Your feedback is appreciated.
Post a Comment


You can use some HTML tags, such as <b>, <i>, <a>

If you see a message that says "your request could not be processed" press preview first and then post.
 
You can follow the discussion of this post by subscribing.


 
You are free to include information from this article on your own site if you provide a backlink. You can use the following markup:
<a href="http://www.myoutsourcedbrain.com/2009/10/blogger-welcome-widget-re-search.html">Blogger: Welcome Widget (Re-Search)</a>


 

Most Viewed

Recent Posts

Blog Archive