| 1 | |||
| 2 | package WWW::Search::Ebay::IT; | ||
| 3 | |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | our | ||
| 8 | 1 | $VERSION = 2.106; | |
| 9 | |||
| 10 | =head1 NAME | ||
| 11 | |||
| 12 | WWW::Search::Ebay::IT - backend for searching auctions at eBay Italy | ||
| 13 | |||
| 14 | =head1 SYNOPSIS | ||
| 15 | |||
| 16 | use WWW::Search; | ||
| 17 | my $oSearch = new WWW::Search('Ebay::IT'); | ||
| 18 | my $sQuery = WWW::Search::escape_query("Yakface"); | ||
| 19 | $oSearch->native_query($sQuery); | ||
| 20 | while (my $oResult = $oSearch->next_result()) | ||
| 21 | { print $oResult->url, "\n"; } | ||
| 22 | |||
| 23 | =head1 DESCRIPTION | ||
| 24 | |||
| 25 | Acts just like WWW::Search::Ebay. | ||
| 26 | |||
| 27 | =head1 AUTHOR | ||
| 28 | |||
| 29 | Martin 'Kingpin' Thurn, C<mthurn at cpan.org>, L<http://tinyurl.com/nn67z>. | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | 1 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 1 | ▶ | use WWW::Search::Ebay 2.258; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | 1 | ▶ | use base 'WWW::Search::Ebay'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 36 | |||
| 37 | sub _native_setup_search | ||
| 38 | 2 | ▶ | { |
|
Subroutine
_native_setup_search: called CC=1 SCAR=0.0
| |||
| 39 | 2 | my ($self, $native_query, $rhOptsArg) = @_; | |
| 40 | 2 | $self->{search_host} = 'http://www.ebay.it'; | |
| 41 | 2 | return $self->SUPER::_native_setup_search($native_query, $rhOptsArg); | |
| 42 | } # _native_setup_search | ||
| 43 | |||
| 44 | |||
| 45 | sub _result_count_pattern | ||
| 46 | 0 | ▶ | { |
|
Subroutine
_result_count_pattern: not called CC=1 SCAR=6.9
| |||
| 47 | 0 | return qr'(\d+)\s+(oggetti|inserzioni|risultati)'; | |
| 48 | } # _result_count_pattern | ||
| 49 | |||
| 50 | |||
| 51 | sub _next_text | ||
| 52 | 0 | ▶ | { |
|
Subroutine
_next_text: not called CC=1 SCAR=6.9
| |||
| 53 | # The text of the "Next" button, localized: | ||
| 54 | 0 | return 'Avanti'; | |
| 55 | } # _next_text | ||
| 56 | |||
| 57 | sub _currency_pattern | ||
| 58 | 1 | ▶ | { |
|
Subroutine
_currency_pattern: called CC=1 SCAR=0.0
| |||
| 59 | 1 | my $self = shift; | |
| 60 | # A pattern to match all possible currencies found in eBay listings | ||
| 61 | # (if one character looks weird, it's really a British Pound symbol | ||
| 62 | # but Emacs shows it wrong): | ||
| 63 | 1 | my $W = $self->whitespace_pattern; | |
| 64 | 1 | return qr{(?:US\s?\$|£|EUR)$W*[\d.,]+}; # } } # Emacs indentation bugfix | |
| 65 | } # _currency_pattern | ||
| 66 | |||
| 67 | sub _preprocess_results_page_OFF | ||
| 68 | 0 | ▶ | { |
|
Subroutine
_preprocess_results_page_OFF: not called CC=1 SCAR=6.9
| |||
| 69 | 0 | my $self = shift; | |
| 70 | 0 | my $sPage = shift; | |
| 71 | # print STDERR Dumper($self->{response}); | ||
| 72 | # For debugging: | ||
| 73 | 0 | print STDERR $sPage; | |
| 74 | 0 | exit 88; | |
| 75 | } # _preprocess_results_page | ||
| 76 | |||
| 77 | sub _columns | ||
| 78 | 0 | ▶ | { |
|
Subroutine
_columns: not called CC=1 SCAR=6.9
| |||
| 79 | 0 | my $self = shift; | |
| 80 | # This is for IT: | ||
| 81 | 0 | return qw( paypal bids price repeat shipping enddate ); | |
| 82 | } # _columns | ||
| 83 | |||
| 84 | sub _process_date_abbrevs | ||
| 85 | 0 | ▶ | { |
|
Subroutine
_process_date_abbrevs: not called CC=1 SCAR=6.9
| |||
| 86 | 0 | my $self = shift; | |
| 87 | 0 | my $s = shift; | |
| 88 | # Convert Italian abbreviations for units of time to something | ||
| 89 | # Date::Manip can parse (namely, English words): | ||
| 90 | 0 | $s =~ s!(\d)g!$1 days!; | |
| 91 | 0 | $s =~ s!(\d)h!$1 hours!; | |
| 92 | 0 | $s =~ s!(\d)m!$1 minutes!; | |
| 93 | 0 | return $s; | |
| 94 | } # _process_date_abbrevs | ||
| 95 | |||
| 96 | |||
| 97 | 1 | 1; | |
| 98 | |||
| 99 | __END__ | ||