| 1 |
|
| 2 |
# $Id: BySellerID.pm,v 2.14 2014-09-01 21:49:09 Martin Exp $ |
| 3 |
|
| 4 |
=head1 NAME |
| 5 |
|
| 6 |
WWW::Search::Ebay::BySellerID - backend for searching eBay for items offered by a particular seller |
| 7 |
|
| 8 |
=head1 SYNOPSIS |
| 9 |
|
| 10 |
use WWW::Search; |
| 11 |
my $oSearch = new WWW::Search('Ebay::BySellerID'); |
| 12 |
my $sQuery = WWW::Search::escape_query("martinthurn"); |
| 13 |
$oSearch->native_query($sQuery); |
| 14 |
while (my $oResult = $oSearch->next_result()) |
| 15 |
{ print $oResult->url, "\n"; } |
| 16 |
|
| 17 |
=head1 DESCRIPTION |
| 18 |
|
| 19 |
See L<WWW::Search::Ebay> for details. |
| 20 |
The query string must be an eBay seller ID. |
| 21 |
|
| 22 |
This class is an Ebay specialization of WWW::Search. |
| 23 |
It handles making and interpreting Ebay searches |
| 24 |
F<http://www.ebay.com>. |
| 25 |
|
| 26 |
This class exports no public interface; all interaction should |
| 27 |
be done through L<WWW::Search> objects. |
| 28 |
|
| 29 |
=head1 NOTES |
| 30 |
|
| 31 |
Searches only for items offered by eBay sellers whose ID matches exactly. |
| 32 |
|
| 33 |
See L<WWW::Search::Ebay> for explanation of the results. |
| 34 |
|
| 35 |
=head1 SEE ALSO |
| 36 |
|
| 37 |
To make new back-ends, see L<WWW::Search>. |
| 38 |
|
| 39 |
=head1 BUGS |
| 40 |
|
| 41 |
Please tell the author if you find any! |
| 42 |
|
| 43 |
=head1 AUTHOR |
| 44 |
|
| 45 |
Martin 'Kingpin' Thurn, C<mthurn at cpan.org>, L<http://tinyurl.com/nn67z>. |
| 46 |
|
| 47 |
=head1 LICENSE |
| 48 |
|
| 49 |
Copyright (C) 1998-2009 Martin 'Kingpin' Thurn |
| 50 |
|
| 51 |
=cut |
| 52 |
|
| 53 |
package WWW::Search::Ebay::BySellerID; |
| 54 |
|
| 55 |
use strict; |
| 56 |
use warnings; |
| 57 |
|
| 58 |
use base 'WWW::Search::Ebay'; |
| 59 |
our |
| 60 |
$VERSION = do { my @r = (q$Revision: 2.14 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; |
| 61 |
|
| 62 |
sub _native_setup_search |
| 63 |
{ |
| 64 |
my ($self, $sQuery, $rh) = @_; |
| 65 |
# As of 2013-03: |
| 66 |
# http://www.ebay.com/sch/allhypedup82/m.html?_ipg=200&_sop=1&_rdc=1 |
| 67 |
$rh->{search_host} = 'http://www.ebay.com'; |
| 68 |
$rh->{search_path} = qq'/sch/$sQuery/m.html'; |
| 69 |
$self->{_options} = { |
| 70 |
_ipg => $self->{_hits_per_page}, |
| 71 |
_rdc => 1, |
| 72 |
_sop => 1, |
| 73 |
}; |
| 74 |
return $self->SUPER::_native_setup_search($sQuery, $rh); |
| 75 |
# Old version: |
| 76 |
$rh->{'MfcISAPICommand'} = 'MemberSearchResult'; |
| 77 |
$rh->{'frompage'} = 'itemsbyseller'; |
| 78 |
$rh->{'sofindtype'} = '26'; |
| 79 |
$rh->{'userid'} = $sQuery; |
| 80 |
# $rh->{'completed'} = 1; # Also return completed auctions |
| 81 |
# $rh->{'since'} = 30; # The oldest possible |
| 82 |
# $rh->{'include'} = 1; # also return bidders email addresses (only |
| 83 |
# possible if you login) |
| 84 |
$rh->{'fcm'} = 0; # Whether to return "similar" user ids |
| 85 |
$rh->{'frpp'} = '200'; # Results per page |
| 86 |
$rh->{'submit'} = 'Search'; |
| 87 |
# Don't know what the rest are for: |
| 88 |
$rh->{'fcl'} = '3'; |
| 89 |
$rh->{'amp;sspagename'} = 'h:h:advsearch:US'; |
| 90 |
$rh->{'sacat'} = '-1'; |
| 91 |
$rh->{'nojspr'} = 'y'; |
| 92 |
$rh->{'catref'} = 'C5'; |
| 93 |
$rh->{'from'} = 'R7'; |
| 94 |
$rh->{'pfid'} = '0'; |
| 95 |
return $self->SUPER::_native_setup_search('', $rh); |
| 96 |
} # _native_setup_search |
| 97 |
|
| 98 |
sub _columns_NOT_NEEDED |
| 99 |
{ |
| 100 |
my $self = shift; |
| 101 |
# This is for basic USA eBay: |
| 102 |
return qw( enddate price repeat bids ); |
| 103 |
} # _columns |
| 104 |
|
| 105 |
1; |
| 106 |
|
| 107 |
__END__ |
| 108 |
|