WordReference API – AJAX SDK & Widget

Yesterday I wrote about the Google API shutdown. It seems that I was wrong in that post about Wordreference not having an API, just a few days earlier founder Michael Kellogg announced the introduction of the brand-spanking new Wordreference API.
Like a dunce I contacted Michael by email to learn about this new revelation without double-checking the site itself (I knew in the past they didn’t have one, as I had checked just a month or so before out of curiosity). It seems that the API was in-development for quite some time, but was rushed out the door on the news of the Google Translate API shutdown. I can easily say that nothing was lost in the final rush, the API is excellent! There are both HTML or JSON versions of the API currently supported and the RESTful URIs make the whole thing quite intuitive to work with.
- A request can be made as follows, to search for the English-to-French translation of “hello world”:
http://api.wordreference.com/API_KEY/enfr/hello - While the same request with just pure JSON data returned would be:
http://api.wordreference.com/API_KEY/json/enfr/hello - For French-to-English, simply use fren as the dictionary, as follows:
http://api.wordreference.com/API_KEY/fren/hello - *Don’t forget that you’ll need to append your own WordReference API Key (previously userID) by adding it to each request in the URL path before the return format, dictionary type, or word/term being looked up. You can sign up for your own API Key using the following form:
http://www.wordreference.com/docs/APIregistration.aspxFor now your userID obtained from viewing your profile after registering and logging into the WordReference Forums can still be used, but later the API will switch over to API Keys only.
- Maybe the coolest thing about the API, is that it supports JSONp callbacks, as in the following request:
http://api.wordreference.com/API_KEY/json/enfr/smile?callback=translate
Awesome! So, feeling a bit dejected earlier this week, yet today having newfound hope for the future of online Translations, I’ve decided to build an SDK and example Widget for the newly released WordReference Dictionary API. I wanted to show multiple ways of interacting with the Translation API (including JSONp, jQuery, YQL, Server Proxy, Cache, etc) all directly via JavaScript. Also, with the completed Widget example, I wanted to show how you can use the API to simulate a full-text translation in real-time, without there being a full-text machine translation feature supported by WordReference (which works on words or phrase lookup only, since it is primarily a dictionary, not a translation service). The only downside of this approach, is that it may result in ALOT of requests to the API.
The CSS presentation styling is extremely minimal, but in the near future I’d consider adding more CSS3 hip features like text-shadows, gradients, transitions/fades and rounded corners. In the meantime, we get this basic CSS:
Read the rest of this entry »
BC$ = Behavior, Content, Money

The goal of the BC$ project is to raise awareness and make changes with respect to the three pillars of information freedom - Behavior (pursuit of interests and passions), Content (sharing/exchanging ideas in various formats), Money (fairness and accessibility) - bringing to light the fact that:
1. We regularly hand over our browser histories, search histories and daily online activities to companies that want our money, or, to benefit from our use of their services with lucrative ad deals or sales of personal information.
2. We create and/or consume interesting content on their services, but we aren't adequately rewarded for our creative efforts or loyalty.
3. We pay money to be connected online (and possibly also over mobile), yet we lose both time and money by allowing companies to market to us with unsolicited advertisements, irrelevant product offers and unfairly structured service pricing plans.