Saturday, February 25, 2006

Google Search History

Ever since Google introduced Search History I have wanted to export the list for my own personal use. There are a variety of things that I want to do with my search history, one of which is creating my own statistical data from the results. Google provides some statistical analysis (use the Trends link) but what if I want to find out my top 20 searches rather than my top 10? Uh oh.

I thought about page scraping but figured there must be a better way. I happen to be on one of my frequent visits to John Resig's blog (by the way John if you ever read this, you are my hero, email me and let's create a web 2.0 app and sell it to Google for 50 mil. I have a few ideas in mind and I know you are already working on a couple independently. Let me know if you need some help with those.) and found this article where John already implemented a page scraping solution to this problem. But, reading further I found this article by Mihai Parparita. Mihai found the magic url to export your search history in xml results, a technique used by the Google Search History Dashboard Widget for Mac's.

If you want to get the low down I recommend reading Mihai's article and then downloading the Mac Widget for yourself to view the source code. If you just want to get your search results in XML format visit the following link:

http://www.google.com/searchhistory/find?num=100&output=rss&client=google-mcsmhwidget&start=1&q=the&zx=MacT0H58Mws%22

You can change the num var in the query string (num=100) to num=n where n is greater than the total number of searches you have done to retrieve all of your search history results. I will warn you, if you have a large search history, as I do, this will take some time so be patient.

Mihai notes that the url is authenticated through the use of a cookie. This means that you will need to log in to authenticate yourself before you will be able to retrieve any results. No problems. Thanks Mihai for pointing out this clever hack. Now we can have our search history the way we want it.

Soon I will be writing a Google Module that uses this exploit to provide users with the ability to customize there Google Search History Module (if somebody doesn't beat me to it).

Get all of the MSN Conspiracy Game Answers here

2 Comments:

At 4/06/2006 3:44 AM, Blogger Mihai Parparita said...

Actually, the persistent.info article with the details of the RSS feed was written by me, not Phil Wilson.

 
At 4/06/2006 5:48 AM, Blogger G00GLEFACT said...

Thanks for the correction Mihai and I apologize for the confusion. I edited the post to give credit where credit is due.

 

Post a Comment

<< Home