File Coverage

blib/lib/WWW/Search/Ebay/BuyItNow.pm
Criterion Covered Total %
statement 12 19 63.1
branch n/a
condition n/a
subroutine 4 6 66.6
pod n/a
total 16 25 64.0


line stmt bran cond sub pod time code
1              
2             # $Id: BuyItNow.pm,v 1.16 2013-06-23 18:31:15 martin Exp $
3              
4             =head1 NAME
5              
6             WWW::Search::Ebay::BuyItNow - backend for searching eBay Buy-It-Now items
7              
8             =head1 SYNOPSIS
9              
10             use WWW::Search;
11             my $oSearch = new WWW::Search('Ebay::BuyItNow');
12             my $sQuery = WWW::Search::escape_query("jawa");
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 Buy-It-Now items only.
29              
30             The query is applied to TITLES only.
31              
32             In the resulting WWW::Search::Result objects, the description field
33             consists of a human-readable combination (joined with semicolon-space)
34             of the Item Number; number of bids; and high bid amount (or starting
35             bid amount).
36              
37             =head1 SEE ALSO
38              
39             To make new back-ends, see L.
40              
41             =head1 BUGS
42              
43             Please tell the author if you find any!
44              
45             =head1 AUTHOR
46              
47             Martin 'Kingpin' Thurn, C, L.
48              
49             =head1 LICENSE
50              
51             Copyright (C) 1998-2009 Martin 'Kingpin' Thurn
52              
53             =cut
54              
55             package WWW::Search::Ebay::BuyItNow;
56              
57 1     1   3422 use strict;
  1         2  
  1         26  
58 1     1   5 use warnings;
  1         3  
  1         30  
59              
60 1     1   6 use WWW::Search::Ebay;
  1         2  
  1         54  
61 1     1   5 use base 'WWW::Search::Ebay';
  1         2  
  1         237  
62             our
63             $VERSION = do { my @r = (q$Revision: 1.16 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r };
64              
65             sub _native_setup_search
66             {
67 0     0     my ($self, $sQuery, $rh) = @_;
68             # http://shop.ebay.com/items/_W0QQLHQ5fBINZ1QQLHQ5fIncludeSIFZ1?_nkw=Burkina+Faso+flag&_sacat=0&_fromfsb=&_trksid=m270.l1313&_odkw=Burkina+Faso&_osacat=0
69             # http://shop.ebay.com/items/_W0QQLHQ5fBINZ1QQLHQ5fIncludeSIFZ1?_nkw=Burkina+Faso+flag
70 0           $self->{search_host} = q{http://shop.ebay.com};
71 0           $self->{search_path} = q{/items/_W0QQLHQ5fBINZ1};
72 0           $self->{'_options'} = {
73             '_nkw' => $sQuery,
74             };
75 0           return $self->SUPER::_native_setup_search($sQuery, $rh);
76             } # _native_setup_search
77              
78             sub _columns
79             {
80 0     0     my $self = shift;
81 0           return qw( price );
82             } # _columns
83              
84             1;
85              
86             __END__