indiWiz.com

Subhash's Tech Log

Archive for the ‘web’ tag

URL Shortners

without comments

Got two news on this topic today:

  1. bit.ly starts offering premium services.
  2. Google launched a URL shortening service.

Written by Subhash Chandran

December 15th, 2009 at 11:57 am

Posted in Uncategorized

Tagged with ,

OpenSearch search providers and browsers

with one comment

All the major browser vendors support the OpenSearch format (yes, this means including Microsoft IE8) for registering a search provider in your browser.

Writing a OpenSearch provider

Recently I wrote a search provider for my favorite book-buying site, Pustak.co.in:

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
	<ShortName>Pustak.co.in</ShortName>
	<Description>Pustak.co.in provider</Description>
	<InputEncoding>UTF-8</InputEncoding>
	<Url type="text/html"
		template="http://pustak.co.in/pustak/books/search?q={searchTerms}&amp;type=book&amp;page=1"/>
</OpenSearchDescription>

Hosting your search provider

To let people use your search provider, you need to host it in the web. For our example, let us assume that you host it here: http://yourhost/your_opensearch.xml.

The MIME type of this document can be left to its default application/xml, or can be made OpenSearch specific: application/opensearchdescription+xml.

Using JavaScript to register a provider

After deploying the OpenSearch XML in your host, we need to write a JavaScript function to register the provider with your browser:

<script type="text/javascript">
function registerYourSearchProvider(){
  window.external.AddSearchProvider("http://yourhost/your_opensearch.xml");
}
</script>

This JavaScript worked with Firefox, IE8 and Google Chrome. Opera 10 was not able to understand it.

Auto-discovering OpenSearch providers

Recently when I saw my Google Chrome search providers, I saw this list:

Chrome Search Providers

I was surprised to see this list because there are providers that I have not added specifically. How was Google Chrome “discovering” these providers?

A look into the HTML source of one of the auto-registering search provider, I found the following info (in the <head> section):

<link rel="search"
       href="/mavensearch.xml"
       type="application/opensearchdescription+xml"
       title="mavensearch.net" />

To let browsers auto-discover you as a search-provider, add the above in your sites!

Written by Subhash Chandran

November 25th, 2009 at 10:36 am

Posted in Uncategorized

Tagged with , ,

Most despicable web browser: IE

without comments

I know I am not the first person to say this. I know I am neither the last. But I am using this post to ease my indignation about a pathetic piece of engineering called IE.

Recently I have been working on portlet development in Liferay. We developed a fancy portlet with Ajax and stuff showing content from a Alfresco deployment. While styling the portlet, I experienced nightmare. The HTML, CSS and JavaScript we developed worked in all browsers, except IE 7. And the reasons for not working are so pathetic: nested divs, nested styling components, menu generation using lists.

I am wondering what kind of coding and engineering effort would have gone into making this crap of a browser called IE. As I am imagining how to write code for parsing and rendering CSS display components, I can feel the awkward code that is inside IE parsing my CSS. Something like graceful degradation and granularity of CSS styles are simple to achieve by “a little thought” while coding. But the crap inside IE makes it so complicated!

I wish there never was a browser called IE.

Written by Subhash Chandran

May 25th, 2009 at 10:12 am

Posted in Software Dev

Tagged with ,