<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: toolbar</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/toolbar.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2005-07-08T10:10:12+00:00</updated><author><name>Simon Willison</name></author><entry><title>Dissecting the Google Firefox Toolbar</title><link href="https://simonwillison.net/2005/Jul/8/toolbar/#atom-tag" rel="alternate"/><published>2005-07-08T10:10:12+00:00</published><updated>2005-07-08T10:10:12+00:00</updated><id>https://simonwillison.net/2005/Jul/8/toolbar/#atom-tag</id><summary type="html">
    &lt;p id="p-0"&gt;Google have finally released a Firefox version of the &lt;a href="http://toolbar.google.com/"&gt;Google Toolbar&lt;/a&gt;, with some nice &lt;a href="http://googleblog.blogspot.com/2005/07/platypus-of-internet.html" title="The platypus of the Internet"&gt;praise for XUL&lt;/a&gt; in to the bargain. Of course, the most interesting part of the toolbar from a geeky point of view is the bit that queries Google's servers for PageRank. Sure enough, if you download the &lt;code&gt;google-toolbar.xpi&lt;/code&gt; file, unzip it, then unzip the &lt;code&gt;google-toolbar.jar&lt;/code&gt; file within there's a file called &lt;code&gt;pagerank.js&lt;/code&gt; with all of the juicy details.&lt;/p&gt;

&lt;p id="p-1"&gt;To query PageRank, the toolbar makes a standard HTTP request to &lt;code&gt;toolbarqueries.google.com&lt;/code&gt;, with the page to query in a parameter along with a hash (presumably to discourage scraping). &lt;code&gt;pagerank.js&lt;/code&gt; includes the hash algorithm, with some amusing implementation details:&lt;/p&gt;

&lt;p id="p-2"&gt;&lt;code class="javascript"&gt;var GPR_HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class="javascript"&gt;function GPR_awesomeHash(value) {
  var &lt;a href="http://www.imdb.com/title/tt0094012/quotes#qt0152593" title="Spaceballs quotes"&gt;kindOfThingAnIdiotWouldHaveOnHisLuggage&lt;/a&gt; = 16909125;
  ...
}&lt;/code&gt;&lt;/pre&gt;

&lt;p id="p-3"&gt;The spell check feature (&lt;code&gt;spellcheck.js&lt;/code&gt;) is interesting as well. When you click the "Check" button, the toolbar packages any content in form fields up in XML and POSTs it to http://www.google.com/tbproxy/spell.  It get backs a simple XML document providing the offset, length and confidence for each spelling error along with a list of suggested alternatives. The user interface stuff is all handled by the extension.&lt;/p&gt;

&lt;p id="p-4"&gt;If you want to watch the toolbar in action, I recommend the fantastic &lt;a href="http://livehttpheaders.mozdev.org/"&gt;LiveHTTPHeaders extension&lt;/a&gt;.&lt;/p&gt;

    
        &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/firefox"&gt;firefox&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/google"&gt;google&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/reverseengineering"&gt;reverseengineering&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/toolbar"&gt;toolbar&lt;/a&gt;&lt;/p&gt;
    

</summary><category term="firefox"/><category term="google"/><category term="reverseengineering"/><category term="toolbar"/></entry></feed>