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

Dear friends, I have a service built upon the Yahoo Perl API but I don't understand if today they have some problems with the service.

Look the simple example after "SYNOPSIS":
http://search.cpan.org/~jfriedl/Yahoo-Search-1.4.7/lib/Yahoo/Search.pm

Today my online service is not able to retrive search results. I tried in local on my PC with this example and I obtain: "error processing XML: oops at Yahoo/Search/XML.pm line 78".

Please can you confirm that the service (Web results )is not available?

Thanks, Vincenzo

Replies are listed 'Best First'.
Re: Yahoo API problems?
by spiritway (Vicar) on Mar 05, 2006 at 00:48 UTC

    Hi, Vincenzio:

    If it's any consolation to you, I get the same error, using that example. Without dissecting the whole module, I couldn't say for sure what the problem is, but I'm thinking that it may have to do with Yahoo! changing their format, and the module not being able to handle the changes. You might find something more specific at Yahoo!'s Developer's Network.

Re: Yahoo API problems?
by roboticus (Chancellor) on Mar 05, 2006 at 14:38 UTC
    Vincenzo-- The example works with the latest version of Yahoo::Search. I compared 1.4.7 with the last version, and found that the problem is that Yahoo seems to have added some whitespace that the search program didn't like/account for. In v1.4.8 they detect & ignore the extra whitespace:

    v1.4.7, XML.pm:
    76: if ($node->{Data}) 77: { 78: die "oops: node Char='$node->{Char}'" if $node->{Char} ne ""; 79: $val = $node->{Data}; 80: }

    v1.4.8, XML.pm:
    76: if ($node->{Data}) 77: { 78: if ($node->{Char} =~ m/^\s*$/) { 79: $node->{Char} = ""; 80: } else { 81: die "oops [$node->{Char}]"; 82: } 83: $val = $node->{Data}; 84: }
    --roboticus
      OK, with the latest version Yahoo-Search-1.5.8 - 04 Mar 2006 now works, but Yahoo should announce every change in the API else developers become crazy. Infact, there is no trace of this little change.

      Thank you very much!

      Vincenzo