File Coverage

blib/lib/WWW/Search/Ebay/Stores.pm
Criterion Covered Total %
statement 9 21 42.8
branch n/a
condition n/a
subroutine 3 6 50.0
pod n/a
total 12 27 44.4


line stmt bran cond sub pod time code
1              
2             # $Id: Stores.pm,v 1.18 2010-04-25 00:03:52 Martin Exp $
3              
4             =head1 NAME
5              
6             WWW::Search::Ebay::Stores - backend for searching eBay Stores
7              
8             =head1 SYNOPSIS
9              
10             use WWW::Search;
11             my $oSearch = new WWW::Search('Ebay::Stores');
12             my $sQuery = WWW::Search::escape_query("C-10 carded Yakface");
13             $oSearch->native_query($sQuery);
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 WWW::Search.
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             The search is done against eBay Stores items only.
29              
30             The query is applied to TITLES only.
31              
32             See L for a description of the search results.
33              
34             =head1 SEE ALSO
35              
36             To make new back-ends, see L.
37              
38             =head1 BUGS
39              
40             Please tell the author if you find any!
41              
42             =head1 AUTHOR
43              
44             Martin 'Kingpin' Thurn, C, L.
45              
46             Some fixes along the way contributed by Troy Davis.
47              
48             =head1 LICENSE
49              
50             Copyright (C) 1998-2009 Martin 'Kingpin' Thurn
51              
52             =cut
53              
54             package WWW::Search::Ebay::Stores;
55              
56 1     1   2385 use strict;
  1         2  
  1         23  
57 1     1   4 use warnings;
  1         2  
  1         31  
58              
59 1     1   4 use base 'WWW::Search::Ebay';
  1         2  
  1         244  
60             our
61             $VERSION = do { my @r = (q$Revision: 1.18 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
62              
63             sub _native_setup_search
64             {
65 0     0     my ($self, $sQuery, $rh) = @_;
66             # As of 2004-10-20:
67             # http://search.stores.ebay.com/search/search.dll?sofocus=bs&sbrftog=1&catref=C6&socurrencydisplay=1&from=R10&sasaleclass=1&sorecordsperpage=100&sotimedisplay=1&socolumnlayout=2&satitle=star+wars+lego&sacategory=-6%26catref%3DC6&bs=Search&sofp=4&sotr=2&sapricelo=&sapricehi=&searchfilters=&sosortproperty=1&sosortorder=1
68             # simplest = http://search.stores.ebay.com/search/search.dll?socurrencydisplay=1&sasaleclass=1&sorecordsperpage=100&sotimedisplay=1&socolumnlayout=2&satitle=star+wars+lego
69             # As of 2005-08-29:
70             # http://search.stores.ebay.com/search/search.dll?satitle=093624-69602-5
71 0           $rh->{'search_host'} = 'http://search.stores.ebay.com';
72 0           $rh->{'search_path'} = '/search/search.dll';
73 0           $rh->{'satitle'} = $sQuery;
74             # Turn off default W::S::Ebay options:
75 0           $self->{_options} = {};
76 0           return $self->SUPER::_native_setup_search($sQuery, $rh);
77             } # _native_setup_search
78              
79             sub _preprocess_results_page_OFF
80             {
81 0     0     my $self = shift;
82 0           my $sPage = shift;
83             # print STDERR Dumper($self->{response});
84             # For debugging:
85 0           print STDERR $sPage;
86 0           exit 88;
87             } # _preprocess_results_page
88              
89             sub _columns_same_as_base_ebay
90             {
91 0     0     my $self = shift;
92             # This is for Stores:
93 0           return qw( paypal bids price enddate );
94             } # _columns
95              
96              
97             1;
98              
99             __END__