line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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, L. |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
package WWW::Search::Ebay::UK; |
28
|
|
|
|
|
|
|
|
29
|
1
|
|
|
1
|
|
379039
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
30
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
83
|
|
33
|
1
|
|
|
1
|
|
328
|
use WWW::Search::Ebay 2.258; |
|
1
|
|
|
|
|
15066
|
|
|
1
|
|
|
|
|
57
|
|
34
|
1
|
|
|
1
|
|
9
|
use base 'WWW::Search::Ebay'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
232
|
|
35
|
|
|
|
|
|
|
our |
36
|
|
|
|
|
|
|
$VERSION = do { my @r = (q$Revision: 2.6 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _native_setup_search |
39
|
|
|
|
|
|
|
{ |
40
|
2
|
|
|
2
|
|
4331831
|
my ($self, $native_query, $rhOptsArg) = @_; |
41
|
2
|
|
|
|
|
9
|
$self->{search_host} = 'http://www.ebay.co.uk'; |
42
|
2
|
|
|
|
|
16
|
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
|
|
|
|
|
|
|
{ |
49
|
|
|
|
|
|
|
return ( |
50
|
0
|
|
|
0
|
|
0
|
'_tag' => 'p', |
51
|
|
|
|
|
|
|
id => 'count' |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
} # _result_count_element_specs |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub _currency_pattern |
57
|
|
|
|
|
|
|
{ |
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
|
|
|
1
|
|
4266488
|
return qr{(?:US\s?\$|£)}; # } } # Emacs indentation bugfix |
62
|
|
|
|
|
|
|
} # _currency_pattern |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub _preprocess_results_page |
65
|
|
|
|
|
|
|
{ |
66
|
0
|
|
|
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
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
0
|
|
|
my $self = shift; |
77
|
|
|
|
|
|
|
# This is for UK: |
78
|
0
|
|
|
|
|
|
return qw( paypal bids price repeat postage enddate ); |
79
|
|
|
|
|
|
|
} # _columns |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
1; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__END__ |