| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package WWW::Search::Ebay::FR; |
|
3
|
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
242713
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
28
|
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
59
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our |
|
8
|
|
|
|
|
|
|
$VERSION = 2.105; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
WWW::Search::Ebay::FR - backend for searching auctions at eBay France |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
use WWW::Search; |
|
17
|
|
|
|
|
|
|
my $oSearch = new WWW::Search('Ebay::FR'); |
|
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, L. |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
|
32
|
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
81
|
|
|
34
|
1
|
|
|
1
|
|
592
|
use WWW::Search::Ebay 2.258; |
|
|
1
|
|
|
|
|
14099
|
|
|
|
1
|
|
|
|
|
49
|
|
|
35
|
1
|
|
|
1
|
|
7
|
use base 'WWW::Search::Ebay'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
343
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _native_setup_search |
|
38
|
|
|
|
|
|
|
{ |
|
39
|
2
|
|
|
2
|
|
5928
|
my ($self, $native_query, $rhOptsArg) = @_; |
|
40
|
2
|
|
|
|
|
7
|
$self->{search_host} = 'http://www.ebay.fr'; |
|
41
|
2
|
|
|
|
|
12
|
return $self->SUPER::_native_setup_search($native_query, $rhOptsArg); |
|
42
|
|
|
|
|
|
|
} # _native_setup_search |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# This is what we look_down for to find the HTML element that contains |
|
45
|
|
|
|
|
|
|
# the result count: |
|
46
|
|
|
|
|
|
|
sub _result_count_element_specs |
|
47
|
|
|
|
|
|
|
{ |
|
48
|
|
|
|
|
|
|
return ( |
|
49
|
0
|
|
|
0
|
|
0
|
'_tag' => 'span', |
|
50
|
|
|
|
|
|
|
class => 'smuy' |
|
51
|
|
|
|
|
|
|
); |
|
52
|
|
|
|
|
|
|
} # _result_count_element_specs |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _result_count_pattern |
|
55
|
|
|
|
|
|
|
{ |
|
56
|
2
|
|
|
2
|
|
144420
|
return qr'(\d+)[^0-9a-z]*(r.sultat|objet|annonce)s'i; |
|
57
|
|
|
|
|
|
|
} # _result_count_pattern |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub _next_text |
|
61
|
|
|
|
|
|
|
{ |
|
62
|
|
|
|
|
|
|
# The text of the "Next" button, localized: |
|
63
|
0
|
|
|
0
|
|
0
|
return 'Suivante'; |
|
64
|
|
|
|
|
|
|
} # _next_text |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub _title_pattern |
|
67
|
|
|
|
|
|
|
{ |
|
68
|
4
|
|
|
4
|
|
12097468
|
my $self = shift; |
|
69
|
4
|
|
|
|
|
39
|
return qr{\A(.+?)\s+EN\s+VENTE\s+SUR\s+EBAY\.FR\s+()\(FIN\s+LE\s+([^)]+)\)}i; |
|
70
|
|
|
|
|
|
|
} # _title_pattern |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub _currency_pattern |
|
73
|
|
|
|
|
|
|
{ |
|
74
|
16
|
|
|
16
|
|
132116
|
my $self = shift; |
|
75
|
|
|
|
|
|
|
# A pattern to match all possible currencies found in eBay listings |
|
76
|
16
|
|
|
|
|
56
|
my $W = $self->whitespace_pattern; |
|
77
|
16
|
|
|
|
|
181
|
return qr{[\d.,]+$W+EUR}; # } } # Emacs indentation bugfix |
|
78
|
|
|
|
|
|
|
} # _currency_pattern |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub _preprocess_results_page_OFF |
|
81
|
|
|
|
|
|
|
{ |
|
82
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
83
|
0
|
|
|
|
|
|
my $sPage = shift; |
|
84
|
|
|
|
|
|
|
# print STDERR Dumper($self->{response}); |
|
85
|
|
|
|
|
|
|
# For debugging: |
|
86
|
0
|
|
|
|
|
|
print STDERR $sPage; |
|
87
|
0
|
|
|
|
|
|
exit 88; |
|
88
|
|
|
|
|
|
|
} # _preprocess_results_page |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub _columns |
|
91
|
|
|
|
|
|
|
{ |
|
92
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
93
|
|
|
|
|
|
|
# This is for FR: |
|
94
|
0
|
|
|
|
|
|
return qw( paypal bids price repeat shipping enddate ); |
|
95
|
|
|
|
|
|
|
} # _columns |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
sub _process_date_abbrevs |
|
98
|
|
|
|
|
|
|
{ |
|
99
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
100
|
0
|
|
|
|
|
|
my $s = shift; |
|
101
|
|
|
|
|
|
|
# Convert French abbreviations for units of time to something |
|
102
|
|
|
|
|
|
|
# Date::Manip can parse (namely, English words): |
|
103
|
0
|
|
|
|
|
|
$s =~ s!(\d)j!$1 days!; |
|
104
|
0
|
|
|
|
|
|
$s =~ s!(\d)h!$1 hours!; |
|
105
|
0
|
|
|
|
|
|
$s =~ s!(\d)m!$1 minutes!; |
|
106
|
0
|
|
|
|
|
|
return $s; |
|
107
|
|
|
|
|
|
|
} # _process_date_abbrevs |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
1; |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
__END__ |