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

once my college professors asked me to simulate google
man..tough one....
so i wikied on the working of google and ended up analyzing the PageRank algo
also i found a lnk to calculate the page rank so i did this
use LWP::Simple;
print "enter url\n";
$url=<>;
$doc=get "http://www.google.com/search?client=navclient-auto&ch=6-1484155081&features=Rank&q=info:$url";
print "$doc\n";
the output was then transfered to a file the file sorted and boom i simulated google (well not exactly.....)
the faculty was so impressed that they gave me an A+ for this and showed this program to te visiting faculty during the fest

Replies are listed 'Best First'.
Re: i did it!!!
by whakka (Hermit) on Jun 26, 2009 at 18:03 UTC
    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!

Re: i did it!!!
by Anonymous Monk on Jun 26, 2009 at 12:53 UTC
    once my college professors asked me to simulate google man..tough one....
    for a whole minute I thought I was going to see a site search algorithm..
Re: i did it!!!
by chrissponias (Initiate) on Jun 28, 2009 at 04:52 UTC
    This is fantastic. Congratulations!