Archive for February, 2007

Currency Conversion and Microformats

Saturday, February 3rd, 2007

I see the solution to this problem comprising of three steps - detecting a currency, performing the conversion, and defining the new user interaction model. Being the result-centric person that I am, lets start by taking a look at how this could work in practice.

Designing the Interaction

Skype is an excellent services, and also is the maker of one of the browser plug-ins which I find the most useful. Often when browsing the web, you may be looking for the contact details of a particular person or organization. In fact, you may want to specifically phone them. Skype offers the ability to make phone calls from your PC, wouldn’t it be great if you could click on a phone number on a web page and have it function exactly like a normal hyperlink but instead of loading a new page, it starts dialing.Thats exactly what the Skype browser plugin does, highlighting numbers on a page and adding additional menu options, allowing you to start a Skype conversation directly from within the browser. Why not do the exact same thing for currencies?We are talking about an interface which is very action orientated, exposing the key functionality which most uses want to access. Like Skype, I think selective highlighting and a context menu would do the job quite nicely. I’m envisioning something like this…currency-highlightcurrency-menuIn addition to highlighing and context menu’s, on a global level, a user should also be able to setup their local currencies and other preferences. If we want to get more advanced, we could also add the ability to automatically perform currency conversions or a mechanism to convert all the currencies on a page in a single swoop.

Performing a Conversion

This is probably the easier of the three problems to solve, or at least, so it seems. Simply make a call to a Web service which performs currency conversion. Does one of these exist? Good question, and one which I think warrants some further investigation.Implications to consider are that any solution would be dependent on this service in order to perform conversions, so it may be prudent to consider service abstraction and redundancy. Perhaps configure the solution to use several different services which provide similar functionality, so if one is down, you have a choice of fallbacks.

Detecting Different Currencies

This is an area where Skype has it easy, there are only a finite number of ways to represent a phone number. Granted they may look slightly different, but they are still easy to find through use of regular expressions. Currencies add many more complexities, one of them being that the same symbol may be used to represent different currencies. For an example, we only need to look as far as the dollar, be it American, Canadian, Australian or from even further afield. What we need here is a microformat.If we look at the microformats wiki, we can see that there are a handful of different proposals for a currency microformat. We can also see that there has been little recent activity, which brings up a pet peeve of mine - there is a lot of focus on hCard, hEvent and other microformats which too be honest are better described as macroformats, and less focus on some of the more basic formats which have the potential to be even more useful, solving issues of parsing.Anyway, this aside, a currency microformat would solve the problem of detection. But in turn introduces a new problem - adoption.Without widespread adoption by web developers, microformats are essentially useless. In the context of currency conversion, this is indeed true as the detection model I’m proposing is dependent on e-commerce sites adopting the microformat. Something which is probably not going to happen. Actually, that may be a bit pessimistic, I can see the likes of Amazon, Yahoo and Google getting onboard but thats it. Even if microformat love explodes this valentines day, you are still dependent on the vendors of e-commerce software sharing this love, and the users of said software upgrading to the microformat loving versions. Perhaps sometime in 2012 then we can depend on microformats alone, but for now we need other options.For detection of currencies I propose three methods:

  • Keep an eye out for whatever becomes the officially recognized currency microformat.
  • Keep an eye out for all the proposed currency microformats until an official format is decided upon (unless one of the proposals would impair parser performance).
  • Keep an eye out for currency symbols and values, making an assumption based on the website URL. So, for example on a .ca site, assume any dollar symbol is referring to a Canadian Dollar amount.

So, where do we go from here?

Good question! I’d love to see these ideas made into a Firefox plugin, and I might even take up the challenge if I ever get some time to work on it! If anyone out there is inspired and wants to help me, then drop me an email. (more…)