Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

WWW-Search module that works

by coder57 (Novice)
on Jun 11, 2007 at 05:27 UTC ( [id://620412]=perlquestion: print w/replies, xml ) Need Help??

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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: WWW-Search module that works
by talexb (Chancellor) on Jun 12, 2007 at 03:07 UTC
      ... none of them seem to work anymore

    Can you define exactly what module functionality "doesn't work anymore"? What are you trying to do? How do the results differ from your expectations?

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      #! usr/bin/perl use strict; use warnings; use WWW::Search; my $oSearch = new WWW::Search('Yahoo::UK'); my $sQuery = WWW::Search::escape_query("spiderman 3 news"); $oSearch->native_query($sQuery); while ( my $oResult = $oSearch->next_result() ) { print "Adding: ", $oResult->url, "\n"; } print ref($oSearch);
      Shows nothing (the same with replacing Yahoo::UK with Altavista/Msn/Alltheweb...)

        OK .. now we're getting somewhere. You've provided some code (great) and told me it outputs nothing.

        My tendency, whenever I create an object, is to make sure that the object is defined. So, in your example, I would check that $oSearch is defined after it's created, and die if not.

        After that, I'd step through the program using the Perl debugger, and find out what's happening. Dump $sQuery and make sure it has something useful in it, and likewise, see what $oResult has.

        Also, your shebang line is wrong. It should probably be

        #!/usr/bin/perl -w
        Try that out and let us know how it goes for you.

        Alex / talexb / Toronto

        "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: WWW-Search module that works
by TGI (Parson) on Jun 14, 2007 at 16:14 UTC

    I'm too rushed to install the library and test it right now, but WWW::Search::Yahoo was last updated April 21, 2007. So it is unlikely to have aged into no longer working. What version are you using? The current Yahoo version is 2.409.

    To check the version of your installed library you can use this one-liner:

    perl -e -MWWW::Search::Yahoo -e 'print $WWW::Search::Yahoo::VERSION'

    If you are on a windows system you'll need to replace the ' with ".

    TGI says moo

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-12 23:11 GMT
Find Nodes?
    Voting Booth?

    No recent polls found