File Coverage

blib/lib/WWW/Search/Ebay/Category.pm
Criterion Covered Total %
statement 23 31 74.1
branch 1 2 50.0
condition 1 2 50.0
subroutine 7 9 77.7
pod n/a
total 32 44 72.7


line stmt bran cond sub pod time code
1              
2             # $Id: Category.pm,v 2.5 2015-09-13 14:27:26 Martin Exp $
3              
4             =head1 NAME
5              
6             WWW::Search::Ebay::Category - backend for returning entire categories on www.ebay.com
7              
8             =head1 SYNOPSIS
9              
10             use WWW::Search;
11             my $oSearch = new WWW::Search('Ebay::Category');
12             # Category 1381 is Disney Modern Premiums:
13             $oSearch->native_query(1381);
14             while (my $oResult = $oSearch->next_result())
15             { print $oResult->url, "\n"; }
16              
17             =head1 DESCRIPTION
18              
19             This class is a Ebay specialization of L.
20             It handles making and interpreting Ebay searches
21             F.
22              
23             This class exports no public interface; all interaction should
24             be done through L objects.
25              
26             =head1 NOTES
27              
28             Returns the "first" 200 *auction* items in the given category.
29             I'm not sure what exactly "first" means in this case; YMMV.
30              
31             It is up to you to determine the number of the category you want.
32              
33             See the NOTES section of L for a description of the results.
34              
35             =head1 METHODS
36              
37             =cut
38              
39             #####################################################################
40              
41             package WWW::Search::Ebay::Category;
42              
43 1     1   469980 use strict;
  1         2  
  1         27  
44 1     1   5 use warnings;
  1         2  
  1         25  
45              
46 1     1   7 use Carp;
  1         3  
  1         47  
47 1     1   5 use Date::Manip;
  1         2  
  1         156  
48 1     1   7 use base 'WWW::Search::Ebay';
  1         3  
  1         358  
49              
50             our
51             $VERSION = do { my @r = (q$Revision: 2.5 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
52              
53             our $MAINTAINER = 'Martin Thurn ';
54              
55 1     1   6 use constant DEBUG_FUNC => 0;
  1         2  
  1         167  
56              
57             sub _native_setup_search
58             {
59 2     2   402420 my ($self, $native_query, $rhOptsArg) = @_;
60 2   50     8 $rhOptsArg ||= {};
61 2 50       20 unless (ref($rhOptsArg) eq 'HASH')
62             {
63 0         0 carp " --- second argument to _native_setup_search should be hashref, not arrayref";
64 0         0 return undef;
65             } # unless
66             $self->{_options} = {
67 2         11 _ipg => 200,
68             _sacat => $native_query,
69             };
70 2         16 return $self->SUPER::_native_setup_search($native_query, $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              
91             1;
92              
93             =head1 SEE ALSO
94              
95             To make new back-ends, see L.
96              
97             =head1 CAVEATS
98              
99             =head1 BUGS
100              
101             Please tell the author if you find any!
102              
103             =head1 AUTHOR
104              
105             Maintained by Martin Thurn, C, L.
106              
107             =head1 LEGALESE
108              
109             Copyright (C) 1998-2009 Martin 'Kingpin' Thurn
110              
111             THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
112             WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
113             MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
114              
115             =cut
116              
117             __END__