line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package WWW::Search::Ebay::FR; |
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
394706
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
49
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our |
8
|
|
|
|
|
|
|
$VERSION = 2.106; |
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
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
62
|
|
34
|
1
|
|
|
1
|
|
427
|
use WWW::Search::Ebay 2.258; |
|
1
|
|
|
|
|
16101
|
|
|
1
|
|
|
|
|
89
|
|
35
|
1
|
|
|
1
|
|
14
|
use base 'WWW::Search::Ebay'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
486
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub _native_setup_search |
38
|
|
|
|
|
|
|
{ |
39
|
2
|
|
|
2
|
|
4352676
|
my ($self, $native_query, $rhOptsArg) = @_; |
40
|
2
|
|
|
|
|
10
|
$self->{search_host} = 'http://www.ebay.fr'; |
41
|
2
|
|
|
|
|
15
|
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
|
0
|
|
|
0
|
|
0
|
return qr'(\d+)\s+(?:résultat|objet|annonce)'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
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
69
|
0
|
|
|
|
|
0
|
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
|
1
|
|
|
1
|
|
3244590
|
my $self = shift; |
75
|
|
|
|
|
|
|
# A pattern to match all possible currencies found in eBay listings |
76
|
1
|
|
|
|
|
15
|
my $W = $self->whitespace_pattern; |
77
|
1
|
|
|
|
|
64
|
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__ |