WWW::Search::Yahoo::Deutschland - class for searching Yahoo! Deutschland (Germany)


WWW-Search-Yahoo-Deutschland documentation Contained in the WWW-Search-Yahoo-Deutschland distribution.

Index


Code Index:

NAME

Top

WWW::Search::Yahoo::Deutschland - class for searching Yahoo! Deutschland (Germany)

SYNOPSIS

Top

  use WWW::Search;
  my $oSearch = new WWW::Search('Yahoo::Deutschland');
  my $sQuery = WWW::Search::escape_query("Perl OOP Freelancer");
  $oSearch->native_query($sQuery);
  while (my $oResult = $oSearch->next_result())
    {
    print $oResult->url, "\n";
    } # while

DESCRIPTION

Top

This class is a Yahoo! Deutschland (Germany) specialization of WWW::Search. It handles making and interpreting searches on Yahoo! Deutschland (Germany) http://de.yahoo.com.

This class exports no public interface; all interaction should be done through WWW::Search objects.

NOTES

Top

SEE ALSO

Top

To make new back-ends, see WWW::Search.

BUGS

Top

Please tell the maintainer if you find any!

TESTING

Top

There are no tests defined for this module.

AUTHOR

Top

WWW::Search::Yahoo::Deutschland is maintained by Martin Thurn (mthurn@cpan.org).

LEGALESE

Top

THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

See WWW::Search for documentation.


WWW-Search-Yahoo-Deutschland documentation Contained in the WWW-Search-Yahoo-Deutschland distribution.
package WWW::Search::Yahoo::Deutschland;

use strict;
use warnings;

use Data::Dumper;  # for debugging only
use WWW::Search::Yahoo;

use vars qw( @ISA $VERSION $MAINTAINER );
@ISA = qw( WWW::Search::Yahoo );

$VERSION = do { my @r = (q$Revision: 1.4 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
$MAINTAINER = 'Martin Thurn <mthurn@cpan.org>';

sub native_setup_search
  {
  my ($self, $sQuery, $rh) = @_;
  # print STDERR " +   in Deutschland::native_setup_search, rh is ", Dumper($rh);
  $self->{'_options'} = {
                         'p' => $sQuery,
                         'y' => 'y',   # german sites only
                         n => 100,
                        };
  $rh->{'search_base_url'} = 'http://de.search.yahoo.com';
  $rh->{'search_base_path'} = '/search/de';
  # print STDERR " +   Yahoo::Deutschland::native_setup_search() is calling SUPER::native_setup_search()...\n";
  return $self->SUPER::native_setup_search($sQuery, $rh);
  } # native_setup_search


sub _string_has_count
  {
  my $self = shift;
  my $s = shift;
  # print STDERR " DDD Deutschland::_string_has_count($s)?\n";
  return $1 if ($s =~ m!\bvon\s+(?:(?:etwa|ungefähr)\s+)?([,.0-9]+)!i);
  return -1;
  } # _string_has_count

sub _a_is_next_link
  {
  my $self = shift;
  my $oA = shift;
  return 0 unless (ref $oA);
  my $sID = $oA->attr('id') || '';
  return 1 if ($sID eq 'pg-next');
  my $s = $oA->as_text;
  my $WS = q{[\t\r\n\240\ ]};
  return ($s =~ m!\A$WS*weitere$WS+&gt;$WS*\z!i);
  } # _a_is_next_link


1;

__END__