As many of you may know, yesterday Google released their (beta) toolbar for Firefox. I was quite excited and snagged a copy. Today, I ran across this review of the Page Rank and spell checking features of the toolbar.
As you’ll notice in the example provided, Google “discourages” the use of their Page Rank code. Besides that, it really holds no interest for me what-so-ever. The spell checking ability, however, does.
Spell checking on the web is an incredibly difficult thing to do. Nothing seems to be perfect, much less easy. Wouldn’t it be great to have an incredible spell checking engine right at your fingertips, particularly one which you didn’t have to manage? I sure think so… So I started looking at the code in more depth, and I soon ran into a problem.
Unfortunately, Mozilla and IE have both disallowed the use of the XMLHttpRequest function to access pages not on your local site. That kinda puts a damper on things. Now you can’t use the standard Ajax approach to use the spell checker. Unless…
The wheels started grinding, and after a little work, I was able to formulate a PHP script that accepts a list of words to spell check as a GET string, then simply POSTs them to Google’s script and spits back out the results, just as Google’s script does.
If you’re interested, you can find my work on the matter here: http://dacnomm.com/googlespell/
A few shoutouts:
1) Photo Matt for starting me on this journey.
2) Simon Willison for adding to my crazed journey, as well as recommending the Live HTTP headers extension for Firefox.
Alright, I’m done! Go spell check your little hearts out!
[...] Incoherent Babble Welcome You Babbling Fool! « Google Spellchecking [...]
Is there any way to make a Firefox extension that just use the spell check functionality of Google? I don’t need the whole toolbar.
I’m sure there is. Unfortunately, that’s beyond my skills. With it, you could directly interact with the Google site, rather than using the self-hosted PHP hack around. Beyond that, I’m afraid I don’t know a thing about extensions.
If you do find such a thing, let me know.
[...] Its actually interesting how many alternatives one can find. Google actually has two. The first is its publicly available Search API which includes an option to returned spell checked items. This looked promising, but the 1000 search limit was disappointing. However, Google provides a secondary service that is for the most part undocumented that is currently utilized by it’s FireFox plugin. Apparently, this undocumented API has been well-known for sometime, going back to 2005 when Google first released its beta Firefox toolbar. What interesting as well (and I tool a look at the source to see it for myself) — is that within the toolbar, Google has a number of code comments that indicate if a specific piece of functionality is intended to be used by outside organizations. A good example of this is the pagerank calls in the toolbar. Comments surround the code that make it clear that this isn’t a publicly available function. However, this isn’t the case with the toolbar spell checker API and after looking through the EULA and doing some web sleuthing, I couldn’t find anyone talking about restrictions to use. Quite the contrary, there are a number of people building interfaces to this api. You can find them here and here and here and here and here. In fact, I could find examples working with this api in PHP, python, C# and PERL. So I figured, why not a ruby. So, last night I wrote a small ruby class to parse this data for LibraryFind. [...]