Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Difficulties with WWW::Search (code)

by deprecated (Priest)
on Nov 08, 2001 at 01:17 UTC ( #123923=perlquestion: print w/replies, xml ) Need Help??

deprecated has asked for the wisdom of the Perl Monks concerning the following question:

sub test_sub { my ($thischan, $thisuser, $thismsg) = (@_); return "test_sub" if @_ == 0; return unless $thismsg =~ /^:google /; use WWW::Search; my $search = new WWW::Search('Google'); $search -> maximum_to_retrieve(5); $search -> native_query(WWW::Search::escape_query("osama")); $search -> seek_result(2); my $result = $search -> results(); use Data::Dumper; print Dumper \$result; carp "cycling"; }
I took the above code, most of it, from WWW::Search::Google's pod, and some of it from one of merlyn's columns. I get the following output:
:google bleh # this was my input Found Total: 1,110,000 $VAR1 = \undef; cycling at test_harness.pl line 31 main::test_sub('#bleh', 'alex', ':google bleh') called at test +_harness.pl line 17
This seems to be totally contrary to what the docs say will happen, and also the results merlyn got. If i switch results to next_result like the supplied POD, i still have the same situation. I'm confused. Has anyone successfully worked with this module? And I cant seem to find it in Super Search.

Oh, and there is a user, google, which is rather irritating when searching for google. alas.

brother dep

update:

i have used several of the search modules including Excite and hotbot to no avail.

--
Laziness, Impatience, Hubris, and Generosity.

Replies are listed 'Best First'.
Re: Difficulties with WWW::Search (code)
by drfrog (Deacon) on Nov 08, 2001 at 02:41 UTC
    Heya:

    I was having probs with the hotbot modules
    i contacted the authors and they updated the hotbot module

    contact them directly about your issues

    the prob with this modules is it directly relates to how the search engine is used
    every time a search engine makes a change these modules must be updated as well


    back in the day we didnt have no old school
Re: Difficulties with WWW::Search (code)
by $code or die (Deacon) on Dec 08, 2001 at 06:04 UTC
    Hi,

    I just tried installing and getting this module to work. I had the same problems.

    I insterted a die $response->content() into the native_retrieve_some method. This was the response from the search:
    Your client from the IP address xxx.xxx.xxx.xxx does not have permission to get URL /search?num=100&q=perl from this server. Please see Google's Terms of Service posted at http://www.google.com/terms_of_service.html
    Those terms restrict "automated querying". So, possibly, this is the same problem you are experiencing.

    I am not going to go into how one might be able to get round this limitation on a public forum like this, but recommend that users contact Google requesting permission or sign up for one of their services. However, I am really surprised that the module doesn't die or warn that a valid search results page was not returned. It might be worth contacting the WWW::Search::Google author.

    Simon Flack ($code or die)
    $,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
    =~y'_"' ';eval"die";print $_,lc substr$@,0,3;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://123923]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-12-03 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (28 votes). Check out past polls.

    Notices?