| 1 | |||
| 2 | # $Id: UK.pm,v 2.6 2013-03-17 01:11:23 Martin Exp $ | ||
| 3 | |||
| 4 | =head1 NAME | ||
| 5 | |||
| 6 | WWW::Search::Ebay::UK - backend for searching auctions at www.ebay.co.uk | ||
| 7 | |||
| 8 | =head1 SYNOPSIS | ||
| 9 | |||
| 10 | use WWW::Search; | ||
| 11 | my $oSearch = new WWW::Search('Ebay::UK'); | ||
| 12 | my $sQuery = WWW::Search::escape_query("Yakface"); | ||
| 13 | $oSearch->native_query($sQuery); | ||
| 14 | while (my $oResult = $oSearch->next_result()) | ||
| 15 | { print $oResult->url, "\n"; } | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | Acts just like WWW::Search::Ebay. | ||
| 20 | |||
| 21 | =head1 AUTHOR | ||
| 22 | |||
| 23 | Martin 'Kingpin' Thurn, C<mthurn at cpan.org>, L<http://tinyurl.com/nn67z>. | ||
| 24 | |||
| 25 | =cut | ||
| 26 | |||
| 27 | package WWW::Search::Ebay::UK; | ||
| 28 | |||
| 29 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 31 | |||
| 32 | 1 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 33 | 1 | ▶ | use WWW::Search::Ebay 2.258; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 34 | 1 | ▶ | use base 'WWW::Search::Ebay'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 35 | our | ||
| 36 | 1 | $VERSION = do { my @r = (q$Revision: 2.6 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; | |
| 37 | |||
| 38 | sub _native_setup_search | ||
| 39 | 2 | ▶ | { |
|
Subroutine
_native_setup_search: called CC=1 SCAR=0.0
| |||
| 40 | 2 | my ($self, $native_query, $rhOptsArg) = @_; | |
| 41 | 2 | $self->{search_host} = 'http://www.ebay.co.uk'; | |
| 42 | 2 | return $self->SUPER::_native_setup_search($native_query, $rhOptsArg); | |
| 43 | } # _native_setup_search | ||
| 44 | |||
| 45 | # This is what we look_down for to find the HTML element that contains | ||
| 46 | # the result count: | ||
| 47 | sub _result_count_element_specs_USE_DEFAULT | ||
| 48 | 0 | ▶ | { |
|
Subroutine
_result_count_element_specs_USE_DEFAULT: not called CC=1 SCAR=6.9
| |||
| 49 | return ( | ||
| 50 | 0 | '_tag' => 'p', | |
| 51 | id => 'count' | ||
| 52 | ); | ||
| 53 | } # _result_count_element_specs | ||
| 54 | |||
| 55 | |||
| 56 | sub _currency_pattern | ||
| 57 | 1 | ▶ | { |
|
Subroutine
_currency_pattern: called CC=1 SCAR=0.0
| |||
| 58 | # A pattern to match all possible currencies found in eBay listings | ||
| 59 | # (if one character looks weird, it's really a British Pound symbol | ||
| 60 | # but Emacs shows it wrong): | ||
| 61 | 1 | return qr{(?:US\s?\$|£)}; # } } # Emacs indentation bugfix | |
| 62 | } # _currency_pattern | ||
| 63 | |||
| 64 | sub _preprocess_results_page | ||
| 65 | 0 | ▶ | { |
|
Subroutine
_preprocess_results_page: not called CC=1 SCAR=6.9
| |||
| 66 | 0 | my $self = shift; | |
| 67 | 0 | my $sPage = shift; | |
| 68 | # print STDERR Dumper($self->{response}); | ||
| 69 | # For debugging: | ||
| 70 | 0 | print STDERR $sPage; | |
| 71 | 0 | exit 88; | |
| 72 | } # preprocess_results_page | ||
| 73 | |||
| 74 | sub _columns | ||
| 75 | 0 | ▶ | { |
|
Subroutine
_columns: not called CC=1 SCAR=6.9
| |||
| 76 | 0 | my $self = shift; | |
| 77 | # This is for UK: | ||
| 78 | 0 | return qw( paypal bids price repeat postage enddate ); | |
| 79 | } # _columns | ||
| 80 | |||
| 81 | 1 | 1; | |
| 82 | |||
| 83 | __END__ | ||