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

As many Monks will already have seen on Slashdot, Google has released an API to allow us to interface direcly with their (massive) engine using SOAP.

This is pretty gosh-darn cool!

This article at O'Reilly.com includes example Perl code, using Soap::Lite.

I'll be playing about with this myself, and I'd be interested to see what other Monks come up with. Perhaps we should have a friendly competition: who can produce the most interesting application of this API?

andy.

Replies are listed 'Best First'.
Re: Google - tastic!
by redsquirrel (Hermit) on Apr 12, 2002 at 15:05 UTC
    In the name of shameless self-promotion, here is a little script that grabs the first result from the query perl golf and redirects to that page. Basically it imitates the I'm Feeling Lucky button.

    Not very intersting, but it might get some people started.

    #!/usr/bin/perl -w use strict; use SOAP::Lite; use CGI qw(redirect); my $key = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'; my $query = 'perl golf'; my $max = 1; my @params = ($key, $query, 0, $max, 0,'',0,'', 'latin1', 'latin1'); my $result = SOAP::Lite -> service('file:GoogleSearch.wsdl') -> doGoogleSearch(@params); print redirect( $result->{resultElements}[0]{URL} );
    To see the script in action, click this. To get the script to work, you need to have GoogleSearch.wsdl in the working directory. This file is available in the API.

    Have fun,
    --Dave

Re: Google - tastic!
by ignatz (Vicar) on Apr 12, 2002 at 15:37 UTC
    While it's an interesting idea, I'd be a little careful before getting too into it. There was a very nice article in the New York Times about their difficulties in bringing in the cash. What is free will most likely soon have strings attached.
    ()-()
     \"/
      `                                                   ` 
    
Careful!
by Dragonfly (Priest) on Apr 12, 2002 at 18:56 UTC
    Although I think it's terrific that Google is opening up their API's, we shouldn't forget the recent security problems with SOAP::Lite.

    I'm not saying this should stop you from going ahead and tinkering with this stuff (I'm sure going to ;-) ... just be careful out there. It seems that it is fairly easy to abuse servers running the SOAP::Lite module, to the point where I heard somebody claim they wrote a script that gave them root access in under two hours. (They also claimed to be somewhat inexpert with Perl, amusingly enough.)

    I'd wait before deploying this on a production box. Anyway, I've gotta get back to this PHP project, see ya around!

      ...we shouldn't forget the recent security problems with SOAP::Lite.
      The security problems only effect SOAP servers, not SOAP clients. There is no known security risk in developing clients with SOAP::Lite.

      --Dave

      I heard somebody claim they wrote a script that gave them root access in under two hours. (They also claimed to be somewhat inexpert with Perl, amusingly enough.)

      Hmm, are you talking about me? Nobody claimed that exploit can give root access. Exploit gives shell access under same UID as SOAP::Lite server runs. Unless server runs under root (very bad idea) exploit cannot give root acccess. And I've never claimed that I'm inexpert in Perl :)

      And anyway redsquirrel is right: exploit is for SOAP::Lite servers, but not for clients.

      --
      Ilya Martynov (http://martynov.org/)

Re: Google - tastic!
by Molt (Chaplain) on Apr 12, 2002 at 15:10 UTC

    Nice, I wonder if that is the reason for them getting the Google-searching WWW::Search CPAN module removed which was reported on use.perl?

    It makes sense if their version is 'nicer' to their servers, I suppose.

Re: Google - tastic!
by drewbie (Chaplain) on Apr 12, 2002 at 14:37 UTC
    One more reason to love Google! Perhaps I can find some time this weekend to start playing with it. Thanks for the link to the O'Reilly article. I'll just ignore the Java stuff he writes about. ;-)
Re: Google - tastic!
by Juerd (Abbot) on Apr 12, 2002 at 15:01 UTC

    I love Google
    Google++

    Yes, I reinvent wheels.
    

Re: Google - tastic!
by kappa (Chaplain) on Apr 16, 2002 at 15:55 UTC
    I want to add that the most recent SOAP::Lite (0.55) not only fixes the above-mentioned vulnerability, but also provides google.pl in examples/ directory. Does anyone want to guess what's in there? :)