http://qs321.pair.com?node_id=775128


in reply to i did it!!!

Congratulations - I had the same feeling the first time I got a bot working the way I wanted to. Especially coming from a non-dev background, I can understand the initial confusion about how the whole "internet" thing works and the warm feelings of demystification.

Now, however, you should start worrying about the other side of the coin. In Google's terms of service they specifically tell you not to do what your program does. Particularly relevant is this section:

5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Google, unless you have been specifically allowed to do so in a separate agreement with Google. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.

And in the robots.txt file (always at http://www.<foo>.com/robots.txt):

User-agent: * Allow: /searchhistory/ Disallow: /search ...

And, by the way, don't be surprised to see your script cause embarrassment when it suddenly stops working. Google is exceptionally good at picking up on scripts like yours and blocking your IP. This happened to me the first time I tried to batch their geocoding service - even when I "randomized" pauses in between requests. They're serious when they say to follow their API and its intended use!