Friday, December 30, 2005

Google Search History Bookmarklet WIP

Francisco and I discovered tonight that Google's "My Search History" changed its bookmarking url. It now requires a special and unique id appended to the url as s=YOURUNIQUEIDHERE. This in turn has made figuring out a generic bookmarklet quite difficult. The fruits of our labor is as such:
      var mykey = "YOURKEYHERE";
      var orig = document.location.href;
      var loc = encodeURIComponent(document.location.href);
      var title = encodeURIComponent(document.title);
      var zx = Math.floor(Math.random()*100000);
      var url = "";
      var url = url + "zx=" + zx + "&s=" + mykey + "&q=" + loc + "&title=" + title;
      var w = open(url,' ','height=450,width=450,scrollbars=1,resizeable=yes');
      w.onload = function(){w.document.location.href='';}()

What does all this gobbly gook mean? If select "Create New Bookmark" in firefox, and then then in the location paste the above code, replacing YOURUNIQUEIDHERE with the contents of the third argument of the _mark() function calls in the source of you can "easily" star websites and keep them forever in your google account.

It works better now, the popped open window displays msh