line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
# $Id: Category.pm,v 1.3 2014-09-09 03:07:56 Martin Exp $ |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
WWW::Search::Ebay::Completed::Category - backend for returning entire categories of completed auctions on www.ebay.com |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 SYNOPSIS |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use WWW::Search; |
11
|
|
|
|
|
|
|
my $oSearch = new WWW::Search('Ebay::Completed::Category'); |
12
|
|
|
|
|
|
|
# Category 35845 is Disney Modern Bottles: |
13
|
|
|
|
|
|
|
$oSearch->native_query(35845); |
14
|
|
|
|
|
|
|
$oSearch->login('ebay_username', 'ebay_password'); |
15
|
|
|
|
|
|
|
while (my $oResult = $oSearch->next_result()) |
16
|
|
|
|
|
|
|
{ print $oResult->url, "\n"; } |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
This class is a Ebay specialization of L. |
21
|
|
|
|
|
|
|
It handles making and interpreting Ebay searches |
22
|
|
|
|
|
|
|
F. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This class exports no public interface; all interaction should |
25
|
|
|
|
|
|
|
be done through L objects. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 NOTES |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Returns the "first" 200 completed items in the given category. |
30
|
|
|
|
|
|
|
I'm not sure what exactly "first" means in this case; YMMV. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
It is up to you to determine the number of the category you want. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
See the NOTES section of L for a description of the results. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHODS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=cut |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
##################################################################### |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
package WWW::Search::Ebay::Completed::Category; |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
2
|
|
224723
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
43
|
|
45
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
34
|
|
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
2
|
|
6
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
87
|
|
48
|
2
|
|
|
2
|
|
10
|
use base 'WWW::Search::Ebay::Completed'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
448
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
our |
51
|
|
|
|
|
|
|
$VERSION = do { my @r = (q$Revision: 1.3 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $MAINTAINER = 'Martin Thurn '; |
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
2
|
|
8
|
use constant DEBUG_FUNC => 0; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
313
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _native_setup_search |
58
|
|
|
|
|
|
|
{ |
59
|
0
|
|
|
0
|
|
|
my ($self, $native_query, $rhOptsArg) = @_; |
60
|
0
|
|
0
|
|
|
|
$rhOptsArg ||= {}; |
61
|
0
|
0
|
|
|
|
|
unless (ref($rhOptsArg) eq 'HASH') |
62
|
|
|
|
|
|
|
{ |
63
|
0
|
|
|
|
|
|
carp " --- second argument to _native_setup_search should be hashref, not arrayref"; |
64
|
0
|
|
|
|
|
|
return undef; |
65
|
|
|
|
|
|
|
} # unless |
66
|
|
|
|
|
|
|
# As of August 2014: |
67
|
|
|
|
|
|
|
# http://www.ebay.com/sch/Magazine-Back-Issues-/280/i.html?_from=R40%7CR40&LH_Complete=1&_udlo=&_udhi=&_ftrt=901&_ftrv=1&_sabdlo=&_sabdhi=&_samilow=&_samihi=&_sadis=10&_fpos=&_fsct=&LH_SALE_CURRENCY=0&_sop=13&_dmd=1&_ipg=50&_nkw=playboy+october+1977 |
68
|
0
|
|
|
|
|
|
$self->{search_host} = 'http://www.ebay.com'; |
69
|
0
|
|
|
|
|
|
$self->{search_path} = sprintf(q{/sch/Foo-/%i/i.html}, $native_query); |
70
|
0
|
|
|
|
|
|
return $self->SUPER::_native_setup_search(q{}, $rhOptsArg); |
71
|
|
|
|
|
|
|
} # _native_setup_search |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub _preprocess_results_page_OFF |
75
|
|
|
|
|
|
|
{ |
76
|
0
|
|
|
0
|
|
|
my $self = shift; |
77
|
0
|
|
|
|
|
|
my $sPage = shift; |
78
|
|
|
|
|
|
|
# For debugging: |
79
|
0
|
|
|
|
|
|
print STDERR $sPage; |
80
|
0
|
|
|
|
|
|
exit 88; |
81
|
|
|
|
|
|
|
} # preprocess_results_page |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub _columns_use_SUPER |
84
|
|
|
|
|
|
|
{ |
85
|
0
|
|
|
0
|
|
|
my $self = shift; |
86
|
|
|
|
|
|
|
# This is for basic USA eBay: |
87
|
0
|
|
|
|
|
|
return qw( paypal bids price shipping enddate ); |
88
|
|
|
|
|
|
|
} # _columns |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 SEE ALSO |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
To make new back-ends, see L. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head1 CAVEATS |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 BUGS |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Please tell the author if you find any! |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 AUTHOR |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Maintained by Martin Thurn, C, L. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 LEGALESE |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
109
|
|
|
|
|
|
|
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
110
|
|
|
|
|
|
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=cut |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
__END__ |