| 1 | # EBayGlobal/ByEndDate.pm | ||||||||||||
| 2 | # by Martin Thurn | ||||||||||||
| 3 | # $Id: ByEndDate.pm,v 1.1 2003-02-06 23:35:18-05 kingpin Exp kingpin $ | ||||||||||||
| 4 | |||||||||||||
| 5 | =head1 NAME | ||||||||||||
| 6 | |||||||||||||
| 7 | WWW::Search::EBayGlobal::ByEndDate - backend for searching worldwide www.ebay.co.uk sites, | ||||||||||||
| 8 | with results sorted with "items ending first" | ||||||||||||
| 9 | |||||||||||||
| 10 | =head1 SYNOPSIS | ||||||||||||
| 11 | |||||||||||||
| 12 | use WWW::Search; | ||||||||||||
| 13 | my $oSearch = new WWW::Search('EBayGlobal::ByEndDate'); | ||||||||||||
| 14 | my $sQuery = WWW::Search::escape_query("C-10 carded Yakface"); | ||||||||||||
| 15 | $oSearch->native_query($sQuery); | ||||||||||||
| 16 | while (my $oResult = $oSearch->next_result()) | ||||||||||||
| 17 | { print $oResult->url, "\n"; } | ||||||||||||
| 18 | |||||||||||||
| 19 | =head1 DESCRIPTION | ||||||||||||
| 20 | |||||||||||||
| 21 | This class is a Ebay.co.uk specialization of WWW::Search. | ||||||||||||
| 22 | It handles making and interpreting Ebay searches | ||||||||||||
| 23 | F<http://www.ebay.co.uk>. | ||||||||||||
| 24 | |||||||||||||
| 25 | This class exports no public interface; all interaction should | ||||||||||||
| 26 | be done through L<WWW::Search> objects. | ||||||||||||
| 27 | |||||||||||||
| 28 | =head1 NOTES | ||||||||||||
| 29 | |||||||||||||
| 30 | The search is done against CURRENT running auctions only. | ||||||||||||
| 31 | |||||||||||||
| 32 | The query is applied to TITLES only. | ||||||||||||
| 33 | |||||||||||||
| 34 | The results are ordered auctions ending soon first (order of | ||||||||||||
| 35 | increasing auction ending date). | ||||||||||||
| 36 | |||||||||||||
| 37 | In the resulting WWW::Search::Result objects, the description field | ||||||||||||
| 38 | consists of a human-readable combination (joined with semicolon-space) | ||||||||||||
| 39 | of the Item Number; number of bids; and high bid amount (or starting | ||||||||||||
| 40 | bid amount). | ||||||||||||
| 41 | |||||||||||||
| 42 | In the WWW::Search::Result objects, the change_date field contains the | ||||||||||||
| 43 | auction ending date & time exactly as returned by ebay.co.uk; this can | ||||||||||||
| 44 | have values like "in 12 mins" or "5d 3h 15m". | ||||||||||||
| 45 | |||||||||||||
| 46 | =head1 SEE ALSO | ||||||||||||
| 47 | |||||||||||||
| 48 | To make new back-ends, see L<WWW::Search>. | ||||||||||||
| 49 | |||||||||||||
| 50 | =head1 CAVEATS | ||||||||||||
| 51 | |||||||||||||
| 52 | =head1 BUGS | ||||||||||||
| 53 | |||||||||||||
| 54 | Please tell the author if you find any! | ||||||||||||
| 55 | |||||||||||||
| 56 | =head1 AUTHOR | ||||||||||||
| 57 | |||||||||||||
| 58 | C<WWW::Search::EBayGlobal::ByEndDate> was written by Martin Thurn | ||||||||||||
| 59 | (mthurn@cpan.org). | ||||||||||||
| 60 | |||||||||||||
| 61 | C<WWW::Search::EBayGlobal::ByEndDate> is maintained by Martin Thurn | ||||||||||||
| 62 | (mthurn@cpan.org). | ||||||||||||
| 63 | |||||||||||||
| 64 | =head1 LEGALESE | ||||||||||||
| 65 | |||||||||||||
| 66 | THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED | ||||||||||||
| 67 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF | ||||||||||||
| 68 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||||||||||||
| 69 | |||||||||||||
| 70 | =head1 VERSION HISTORY | ||||||||||||
| 71 | |||||||||||||
| 72 | =head2 2.02 | ||||||||||||
| 73 | |||||||||||||
| 74 | Fixed hash vs. array bug? | ||||||||||||
| 75 | |||||||||||||
| 76 | =head2 2.01 | ||||||||||||
| 77 | |||||||||||||
| 78 | First publicly-released version. | ||||||||||||
| 79 | |||||||||||||
| 80 | =cut | ||||||||||||
| 81 | |||||||||||||
| 82 | ##################################################################### | ||||||||||||
| 83 | |||||||||||||
| 84 | package WWW::Search::EBayGlobal::ByEndDate; | ||||||||||||
| 85 | |||||||||||||
| 86 | 1 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 87 | 1 | ▶ | use WWW::Search::EBayGlobal; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 88 | 1 | @ISA = qw( WWW::Search::EBayGlobal ); | |||||||||||
| 89 | |||||||||||||
| 90 | 1 | $VERSION = '2.02'; | |||||||||||
| 91 | 1 | $MAINTAINER = 'Martin Thurn <mthurn@cpan.org>'; | |||||||||||
| 92 | |||||||||||||
| 93 | # private | ||||||||||||
| 94 | sub native_setup_search | ||||||||||||
| 95 | 1 | ▶ | { | ||||||||||
|
Subroutine
native_setup_search: called CC=3 SCAR=12.3
Pod
undocumented
| |||||||||||||
| 96 | 1 | my ($self, $native_query, $rhOptsArg) = @_; | |||||||||||
| 97 | 1 | ▶ | $rhOptsArg ||= {}; | ||||||||||
|
Condition50%1/2
$rhOptsArg ||= {}
MC/DC0%0/1
$rhOptsArg ||= {}
$rhOptsArg
Truth table50%1/2
A
A= $rhOptsArg
| |||||||||||||
| 98 | 1 | ▶ | unless (ref($rhOptsArg) eq 'HASH') | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 99 | { | ||||||||||||
| 100 | 0 | carp " --- second argument to native_setup_search should be hashref, not arrayref"; | |||||||||||
| 101 | 0 | return undef; | |||||||||||
| 102 | } # unless | ||||||||||||
| 103 | 1 | $rhOptsArg->{'SortProperty'} = 'MetaEndSort'; | |||||||||||
| 104 | 1 | return $self->SUPER::native_setup_search($native_query, $rhOptsArg); | |||||||||||
| 105 | } # native_setup_search | ||||||||||||
| 106 | |||||||||||||
| 107 | 1 | 1; | |||||||||||
| 108 | |||||||||||||
| 109 | __END__ | ||||||||||||