WWW-Search-Ebay-3.042/0000755000000000000000000000000012575327516013002 5ustar rootrootWWW-Search-Ebay-3.042/t/0000755000000000000000000000000012575327516013245 5ustar rootrootWWW-Search-Ebay-3.042/t/itemnumber.t0000644000000000000000000000072012114552301015555 0ustar rootroot # $Id: itemnumber.t,v 1.15 2013-03-03 03:42:41 Martin Exp $ use Data::Dumper; use ExtUtils::testlib; use Test::More no_plan; use WWW::Search::Test; BEGIN { use_ok('WWW::Search::Ebay'); } # end of BEGIN block use strict; my $iDebug; my $iDump; tm_new_engine('Ebay'); $iDebug = 0; $iDump = 0; TODO: { our $TODO = q{If you really need this functionality, notify the author}; tm_run_test('normal', '140920371428', 1, 1, $iDebug, $iDump); } __END__ WWW-Search-Ebay-3.042/t/coverage.t0000644000000000000000000000206012114301127015176 0ustar rootroot # $Id: coverage.t,v 1.4 2006-01-08 03:27:13 Daddy Exp $ use ExtUtils::testlib; use Test::More no_plan; use IO::Capture::Stderr; my $oICE = IO::Capture::Stderr->new; BEGIN { use_ok('WWW::Search') }; BEGIN { use_ok('WWW::Search::Ebay') }; my $iDebug; my $iDump = 0; my $o = new WWW::Search('Ebay'); $o->{_debug} = 1; $oICE->start; # Trigger all the options-list handling: $o->native_query('junk', { search_debug => 1, search_parse_debug => 1, foo => 'bar', search_foo => undef, baz => undef, }, ); $oICE->stop; my $o1 = new WWW::Search('Ebay'); # Call native_query with no options: $o1->native_query('junk'); # Do an actual search with debugging turned on: $oICE->start; $o1->native_query('star wars taco bell', { search_debug => 1, search_parse_debug => 1, }, ); $o1->next_result; $oICE->stop; exit 0; __END__ WWW-Search-Ebay-3.042/t/category.t0000644000000000000000000000461512534655335015253 0ustar rootroot # $Id: category.t,v 1.3 2013-03-03 03:42:41 Martin Exp $ use blib; use Bit::Vector; use Data::Dumper; use Test::More no_plan; use WWW::Search::Test; BEGIN { use_ok('WWW::Search::Ebay::Category'); } # end of BEGIN block my $iDebug; my $iDump = 0; tm_new_engine('Ebay::Category'); # goto MULTI_RESULT; # goto DEBUG_NOW; # goto CONTENTS; diag("Sending 0-page category query..."); $iDebug = 0; # This test returns no results (but we should not get an HTTP error): tm_run_test('normal', $WWW::Search::Test::bogus_query, 0, 0, $iDebug); # DEBUG_NOW: pass; goto SKIP_MULTI_RESULT; MULTI_RESULT: { $TODO = 'WWW::Search::Ebay can not fetch multiple pages'; diag("Sending multi-page category query..."); $iDebug = 0; $iDump = 0; # This query returns dozens of pages of results: tm_run_test('normal', '1380', 222, undef, $iDebug); cmp_ok(1, '<', $WWW::Search::Test::oSearch->{requests_made}, 'got multiple pages'); $TODO = ''; } # end of MULTI_RESULT block SKIP_MULTI_RESULT: pass; DEBUG_NOW: pass; CONTENTS: diag("Sending 1-page category query to check contents..."); $iDebug = 0; $iDump = 0; $WWW::Search::Test::sSaveOnError = q{category-failed.html}; tm_run_test('normal', 147399, 1, 199, $iDebug, $iDump); # Now get the results and inspect them: my @ao = $WWW::Search::Test::oSearch->results(); cmp_ok(0, '<', scalar(@ao), 'got some results'); # We perform this many tests on each result object: my $iTests = 5; my $iAnyFailed = 0; my ($iVall, %hash); my $oV = new Bit::Vector($iTests); $oV->Fill; $iVall = $oV->to_Dec; foreach my $oResult (@ao) { $oV->Bit_Off(0) unless like($oResult->url, qr{\Ahttp://(cgi|www)\d*\.ebay\.com}, 'result URL is really from ebay.com'); $oV->Bit_Off(1) unless cmp_ok($oResult->title, 'ne', '', 'result Title is not empty'); $oV->Bit_Off(3) unless like($oResult->description, qr{(\d+|no)\sbids?;}, 'result bid count is ok'); $oV->Bit_Off(4) unless like($oResult->description, qr{(starting|current)\sbid\s}, 'result bid amount is ok'); my $iV = $oV->to_Dec; if ($iV < $iVall) { $hash{$iV} = $oResult; $iAnyFailed++; } # if } # foreach if ($iAnyFailed) { diag(" Here are results that exemplify the failures:"); while (my ($sKey, $sVal) = each %hash) { diag(Dumper($sVal)); } # while } # if SKIP_CONTENTS: ; __END__ WWW-Search-Ebay-3.042/t/pod-coverage.t0000644000000000000000000000131711237425627016003 0ustar rootroot # $Id: pod-coverage.t,v 1.2 2009-08-09 01:51:19 Martin Exp $ use strict; use warnings; use Test::More; use blib; # BEGIN { sub Pod::Coverage::TRACE_ALL () { 1 } } # BEGIN { sub TRACE_ALL () { 1 } } # Ensure a recent version of Test::Pod::Coverage my $min_tpc = 1.08; eval "use Test::Pod::Coverage $min_tpc"; plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" if $@; # Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, # but older versions don't recognize some common documentation styles my $min_pc = 0.18; eval "use Pod::Coverage $min_pc"; plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" if $@; all_pod_coverage_ok(); __END__ WWW-Search-Ebay-3.042/t/pod.t0000644000000000000000000000027512114301127014173 0ustar rootroot# $Id: pod.t,v 1.1 2007-05-20 13:39:02 Daddy Exp $ use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); __END__ WWW-Search-Ebay-3.042/t/ebay.t0000644000000000000000000001045212534647453014354 0ustar rootroot # $Id: ebay.t,v 1.21 2015-06-06 19:51:07 Martin Exp $ use strict; use warnings; use constant DEBUG_CONTENTS => 0; use Bit::Vector; use Data::Dumper; use Date::Manip; use ExtUtils::testlib; use Test::More 'no_plan'; use WWW::Search; use WWW::Search::Test; BEGIN { use blib; use_ok('WWW::Search::Ebay'); } # end of BEGIN block my $iDebug; my $iDump = 0; tm_new_engine('Ebay'); # goto ISBN; # goto DEBUG_NOW; goto CONTENTS if DEBUG_CONTENTS; # goto SPELL_TEST; diag("Sending 0-page ebay queries..."); $iDebug = 0; # This test returns no results (but we should not get an HTTP error): tm_run_test('normal', $WWW::Search::Test::bogus_query, 0, 0, $iDebug); SPELL_TEST: pass('no-op'); # There are no hits for "laavar", make sure Ebay.pm does not return # the "lavar" hits: $iDebug = 0; # tm_run_test('normal', 'laavar', 0, 0, $iDebug, 'dump'); $iDebug = 0; # tm_run_test('normal', 'no products match this entire phrase', 0, 0, $iDebug, 'dump'); # goto ALL_DONE; DEBUG_NOW: pass('no-op'); MULTI_RESULT: { $TODO = 'WWW::Search::Ebay can not fetch multiple pages'; diag("Sending multi-page ebay query..."); $iDebug = 0; $iDump = 0; # This query returns hundreds of pages of results: tm_run_test('normal', 'LEGO', 101, undef, $iDebug); cmp_ok(1, '<', $WWW::Search::Test::oSearch->{requests_made}, 'got multiple pages'); $TODO = ''; } # end of MULTI_PAGE block # goto SKIP_CONTENTS; # for debugging if (0) { # The intention of this test block is to retrieve a page that # returns hits on the exact query term, AND hits on alternate # spellings. It's just too hard to find such a word that # consistently performs as needed. $TODO = "Sometimes there are NO hits for lavarr"; diag("Sending 1-page ebay queries..."); # There are a few hits for "lavarr", and eBay also gives us all the # "lavar" hits: $iDebug = 0; tm_run_test('normal', 'lavarr', 1, 99, $iDebug); $TODO = ''; } # if UPC: { $TODO = 'too hard to find a consistent EAN'; diag("Sending 1-page ebay query for 12-digit UPC..."); $iDebug = 0; $iDump = 0; tm_run_test('normal', '0-77778-60672-7' , 1, 99, $iDebug, $iDump); $TODO = ''; } # end of UPC block EAN: { $TODO = 'too hard to find a consistent EAN'; diag("Sending 1-page ebay query for 13-digit EAN..."); $iDebug = 0; $iDump = 0; tm_run_test('normal', '00-77778-60672-7' , 1, 99, $iDebug, $iDump); $TODO = ''; } # end of EAN block ISBN: { $TODO = q{I don't know why, but this test has more false negatives than almost any other}; diag("Sending 1-page ebay query for 10-digit ISBN..."); $iDebug = 0; $iDump = 0; tm_run_test('normal', '0-553-09606-0' , 1, 99, $iDebug, $iDump); $TODO = q{}; } # end of ISBN block # goto SKIP_CONTENTS; CONTENTS: diag("Sending 1-page ebay query to check contents..."); $iDebug = DEBUG_CONTENTS ? 2 : 0; $iDump = 0; $WWW::Search::Test::sSaveOnError = q{ebay-1-failed.html}; # }; # Emacs bug my $sQuery = 'trinidad tobago flag'; # $sQuery = 'church spread wings'; # Special debugging tm_run_test('normal', $sQuery, 1, 99, $iDebug, $iDump); # Now get the results and inspect them: my @ao = $WWW::Search::Test::oSearch->results(); cmp_ok(0, '<', scalar(@ao), 'got some results'); my $sBidPattern = 'bid\s+'. $WWW::Search::Test::oSearch->_currency_pattern .'\s?[,.0-9]+'; my $qrBid = qr{\b$sBidPattern}; my @ara = ( ['description', 'like', $qrBid, 'description contains bid amount'], ['description', 'like', qr{Item #\d+;}, 'description contains item #'], ['url', 'like', qr(\Ahttp://(cgi|www)\d*\.ebay\.com), # ), # Emacs bug q'URL is from ebay.com'], # '], # Emacs bug ['title', 'ne', 'q{}', 'result Title is not empty'], ['change_date', 'date', 'change_date is really a date'], ['description', 'like', qr{\b(\d+|no)\s+bids?}, # }, # Emacs bug 'result bidcount is ok'], ['bid_count', 'like', qr{\A\d+\Z}, 'bid_count is a number'], # ['shipping', 'like', qr{\A(free|[0-9\$\.]+)\Z}i, 'shipping looks like a money value'], ['category', 'like', qr{\A-?\d+\Z}, 'category is a number'], ); WWW::Search::Test::test_most_results(\@ara, 1.00); # Sanity check for new category list parsing: # print STDERR Dumper($WWW::Search::Test::oSearch->{categories}); SKIP_CONTENTS: pass('no-op'); ALL_DONE: pass('all done'); __END__ WWW-Search-Ebay-3.042/t/enddate.t0000644000000000000000000000317112534647453015040 0ustar rootroot # $Id: enddate.t,v 1.14 2015-06-06 19:51:07 Martin Exp $ use strict; use warnings; use blib; use Data::Dumper; use Date::Manip; $ENV{TZ} = 'EST5EDT'; # Date_Init('TZ=EST5EDT'); use ExtUtils::testlib; use Test::More 'no_plan'; use WWW::Search; use WWW::Search::Test; use constant DEBUG_DATE => 0; my $iDebug = 0; my $iDump = 0; tm_new_engine('Ebay::ByEndDate'); # goto TEST_NOW; pass('no-op'); TEST_NOW: pass('no-op'); diag("Sending end-date query..."); $iDebug = 0; $iDump = 0; # We need a query that returns "Featured Items" _and_ items that end # in a few minutes. This one attracts Rock'n'Roll fans and # philatelists: TODO: { $TODO = 'We only need one page of results in order to test the end-date sort'; tm_run_test('normal', 'zeppelin', 45, 49, $iDebug, $iDump); } $TODO = ''; # goto ALL_DONE; # for debugging # Now get some ByEndDate results and inspect them: my @ao = $WWW::Search::Test::oSearch->results(); cmp_ok(0, '<', scalar(@ao), 'got some results'); my $sDatePrev = 'yesterday'; foreach my $oResult (@ao) { like($oResult->url, qr{\Ahttp://(cgi|www)\d*\.ebay\.com}, 'result URL really is from ebay.com'); cmp_ok($oResult->title, 'ne', '', 'result Title is not empty'); like($oResult->description, qr{([0-9]+|no)\s+bids?}, 'result bidcount is ok'); my $sDate = $oResult->change_date || ''; DEBUG_DATE && diag(qq{raw result date is '$sDate'}); diag(Dumper($oResult)) unless isnt($sDate, ''); my $iCmp = Date_Cmp($sDatePrev, $sDate); cmp_ok($iCmp, '<=', 0, 'result is in order by end date'); $sDatePrev = $sDate; } # foreach pass('no-op'); ALL_DONE: pass('no-op'); exit 0; __END__ WWW-Search-Ebay-3.042/xt/0000755000000000000000000000000012575327516013435 5ustar rootrootWWW-Search-Ebay-3.042/xt/buyitnow.t0000644000000000000000000000512112575304161015470 0ustar rootroot # $Id: buyitnow.t,v 1.1 2015-09-13 14:30:09 Martin Exp $ use blib; use Bit::Vector; use Data::Dumper; use Date::Manip; use Test::More no_plan; use WWW::Search::Test; BEGIN { use_ok('WWW::Search::Ebay::BuyItNow'); } my $iDebug; my $iDump = 0; tm_new_engine('Ebay::BuyItNow'); # goto MULTI_RESULT; # goto DEBUG_NOW; # goto CONTENTS; diag("Sending 0-page buy-it-now query..."); $iDebug = 0; # This test returns no results (but we should not get an HTTP error): tm_run_test('normal', $WWW::Search::Test::bogus_query, 0, 0, $iDebug); # DEBUG_NOW: pass; MULTI_RESULT: { $TODO = 'WWW::Search::Ebay can not fetch multiple pages'; diag("Sending multi-page buy-it-now query..."); $iDebug = 0; $iDump = 0; # This query returns hundreds of pages of results: tm_run_test('normal', 'LEGO', 222, undef, $iDebug); cmp_ok(1, '<', $WWW::Search::Test::oSearch->{requests_made}, 'got multiple pages'); $TODO = ''; } # DEBUG_NOW: pass; TODO: { $TODO = 'sometimes there are too many of this book for sale'; diag("Sending 1-page buy-it-now query for 12-digit UPC..."); $iDebug = 0; $iDump = 0; tm_run_test('normal', '0-77778-60672-7' , 1, 99, $iDebug, $iDump); $TODO = ''; } # end of TODO pass; TODO: { $TODO = 'sometimes there are zero of this item'; diag("Sending 1-page buy-it-now query for 13-digit EAN..."); $iDebug = 0; $iDump = 0; tm_run_test('normal', '00-75678-26382-8' , 1, 99, $iDebug, $iDump); $TODO = ''; } DEBUG_NOW: diag("Sending 1-page buy-it-now query for 10-digit ISBN..."); TODO: { $TODO = 'sometimes there are none of this book for sale'; $iDebug = 0; $iDump = 0; tm_run_test('normal', '0-395-52021-5' , 1, 99, $iDebug, $iDump); $TODO = ''; } # end of TODO block # goto SKIP_CONTENTS; CONTENTS: diag("Sending 1-page buy-it-now query to check contents..."); $iDebug = 0; $iDump = 0; $WWW::Search::Test::sSaveOnError = q{buyitnow-failed.html}; tm_run_test('normal', 'Kenya waterfall', 1, 199, $iDebug, $iDump); # Now get the results and inspect them: my @ao = $WWW::Search::Test::oSearch->results(); cmp_ok(0, '<', scalar(@ao), 'got some results'); my @ara; push @ara, [ url => like => qr{\Ahttp://(cgi|www)\d*\.ebay\.com}, 'result URL is really from ebay.com' ]; push @ara, [ title => ne => q{''}, 'result title is not empty', ]; push @ara, [ description => like => qr{no\s+bids;}, 'bid count is ok', ]; push @ara, [ description => like => qr{starting\sbid}, 'result bid amount is ok' ]; WWW::Search::Test::test_most_results(\@ara); SKIP_CONTENTS: ; __END__ WWW-Search-Ebay-3.042/xt/bysellerid.t0000644000000000000000000000416312575304161015753 0ustar rootroot # $Id: bysellerid.t,v 1.1 2015-09-13 14:30:09 Martin Exp $ use constant DEBUG_CONTENTS => 0; use Date::Manip; use ExtUtils::testlib; use Test::More no_plan; use WWW::Search; use WWW::Search::Test; BEGIN { use blib; use_ok('WWW::Search::Ebay::BySellerID'); } # end of BEGIN block my $iDebug; my $iDump; tm_new_engine('Ebay::BySellerID'); # goto DEBUG_NOW; goto CONTENTS if DEBUG_CONTENTS; # goto CONTENTS; diag("Sending 0-page seller ID query..."); $iDebug = 0; $iDump = 0; # This test returns no results (but we should not get an HTTP error): tm_run_test('normal', $WWW::Search::Test::bogus_query, 0, 0, $iDebug, $iDump); goto SKIP_MULTI; pass('no-op'); # DEBUG_NOW: pass('no-op'); MULTI_RESULT: { $TODO = 'WWW::Search::Ebay can not fetch multiple pages'; diag("Sending multi-page seller ID query..."); $iDebug = 0; $iDump = 0; # This query returns many pages of results: tm_run_test('normal', 'toymom21957', 200, undef, $iDebug); cmp_ok(1, '<', $WWW::Search::Test::oSearch->{requests_made}, 'got multiple pages'); $TODO = q{}; } DEBUG_NOW: pass('no-op'); SKIP_MULTI: pass('no-op'); CONTENTS: diag("Sending 1-page seller ID query to check contents..."); $iDebug = DEBUG_CONTENTS ? 2 : 0; $iDump = 0; $WWW::Search::Test::sSaveOnError = q{bysellerid-failed.html}; # local $TODO = 'Too hard to find a seller with consistently one page of auctions'; tm_run_test('normal', 'oldschool2017', 1, 199, $iDebug, $iDump); # Now get the results and inspect them: my @ao = $WWW::Search::Test::oSearch->results(); cmp_ok(0, '<', scalar(@ao), 'got some results'); my @ara = ( ['url', 'like', qr{\Ahttp://(cgi|www)\d*\.ebay\.com}, 'URL is really from ebay.com'], ['title', 'ne', 'q{}', 'Title is not empty'], ['change_date', 'date', 'change_date is really a date'], ['description', 'like', qr{Item #\d+;}, 'description contains item #'], ['description', 'like', qr{\b(\d+|no)\s+bids?}, # }, # Emacs bug 'result bidcount is ok'], ['bid_count', 'like', qr{\A\d+\Z}, 'bid_count is a number'], ); WWW::Search::Test::test_most_results(\@ara, 0.95); __END__ WWW-Search-Ebay-3.042/Changes0000644000000000000000000003346412575325532014303 0ustar rootroot2015-09-13 Kingpin * lib/WWW/Search/Ebay.pm: added warning if no results count found (_parse_tree): do not parse any results if eBay says there are none 2015-06-06 Kingpin * lib/WWW/Search/Ebay.pm (_get_result_count_elements): new tag * lib/WWW/Search/Ebay/ByEndDate.pm (_native_setup_search): updated for new Date::Manip timezone stupidity * multiple files: updated for new Date::Manip TZ stupidity 2015-02-20 Kingpin * lib/WWW/Search/Ebay.pm (_parse_tree): improved parsing for completed auctions 2014-09-01 Kingpin * lib/WWW/Search/Ebay.pm: updated for new eBay HTML page structure 2013-11-28 Kingpin * lib/WWW/Search/Ebay.pm: removed pod about category in results * lib/WWW/Search/Ebay.pm (_parse_tree): check for category overflow in results 2013-10-05 Kingpin * MANIFEST.SKIP: don't ship MYMETA files 2013-08-20 Kingpin * lib/WWW/Search/Ebay.pm (_parse_bids): make sure bid_count is a number (_parse_tree): initialize bid_count to 0 2013-06-23 Kingpin * lib/WWW/Search/Ebay.pm (_get_itemtitle_tds): fixed for new eBay page layout 2010-08-17 Kingpin * lib/WWW/Search/Ebay.pm (_parse_tree): fixed regex for item number 2010-08-01 Kingpin * lib/WWW/Search/Ebay.pm (_result_count_pattern): fixed regexen for result count, price, date 2010-05-20 Kingpin * lib/WWW/Search/Ebay.pm (_parse_enddate): fixed the time-remaining regex 2009-08-30 Kingpin * lib/WWW/Search/Ebay/BuyItNow.pm (_columns): updated for new eBay output * lib/WWW/Search/Ebay.pm (_parse_enddate): fixed for Buy-It-Now auctions 2009-08-10 Kingpin * lib/WWW/Search/Ebay.pm (_parse_price): fixed for "Free Shipping" in the bid column 2009-08-08 Kingpin * lib/WWW/Search/Ebay/Stores.pm: fixed for new HTML format * lib/WWW/Search/Ebay.pm (_columns): fixed for new HTML format * lib/WWW/Search/Ebay/BySellerID.pm (_columns): fixed for new HTML format 2009-02-22 Kingpin * lib/WWW/Search/Ebay.pm (_parse_tree): fixed undef warning (_get_result_count_elements): added element for ::Category search 2009-01-21 Kingpin * lib/WWW/Search/Ebay/Completed/Category.pm: new module 2009-01-19 Kingpin * lib/WWW/Search/Ebay/Category.pm: new backend 2009-01-18 Kingpin * lib/WWW/Search/Ebay.pm (_parse_tree): mark item as "sold" if ended and bidded (fix for Ebay::Completed) 2008-11-10 Kingpin * lib/WWW/Search/Ebay.pm (_parse_tree): fixed patterns for detecting spell-checked query 2008-11-09 Kingpin * lib/WWW/Search/Ebay.pm (_parse_tree): fixed "infinite" looping of page requests 2008-09-06 Kingpin * lib/WWW/Search/Ebay.pm (_get_result_count_elements): added pattern for new motors layout (_result_count_pattern): match commas in result count! (_parse_tree): delete commas from result_count 2008-08-10 Kingpin * lib/WWW/Search/Ebay/Stores.pm (_columns): fixed for new page layout? 2008-06-28 Kingpin * lib/WWW/Search/Ebay.pm (preprocess_results_page): use our own UserAgent to fetch the official eBay time (not a generic LWP::UserAgent) 2008-04-05 * lib/WWW/Search/Ebay/ES.pm (result_count_pattern): fixed 2008-02-25 * lib/WWW/Search/Ebay.pm (user_agent_delay): new method 2008-02-24 * lib/WWW/Search/Ebay/Motors.pm (result_count_pattern): new methods * lib/WWW/Search/Ebay/FR.pm (title_pattern): new method * lib/WWW/Search/Ebay.pm (title_pattern): new method (result_count_regex): renamed method and made public 2007-12-05 * lib/WWW/Search/Ebay.pm (_result_count_regex): allow one hit to match! * lib/WWW/Search/Ebay/IT.pm (_result_count_regex): fixed pattern 2007-12-02 * lib/WWW/Search/Ebay.pm (parse_tree): ignore auctions from other countries 2007-08-20 * lib/WWW/Search/Ebay.pm: FIXED page title regex 2007-05-20 * lib/WWW/Search/Ebay/ES.pm (_result_count_regex): fixed result-count parsing * lib/WWW/Search/Ebay/DE.pm (_process_date_abbrevs): fixed date parsing 2007-01-29 * lib/WWW/Search/Ebay.pm (result_as_HTML): now takes an optional date format argument 2007-01-26 * lib/WWW/Search/Ebay.pm (result_as_HTML): added end-time to "ended" items 2006-12-24 * lib/WWW/Search/Ebay.pm (result_as_HTML): added "add to myEbay" link 2006-09-03 * lib/WWW/Search/Ebay.pm (whitespace_pattern): new method * lib/WWW/Search/Ebay/ES.pm: new backend * lib/WWW/Search/Ebay/FR.pm: new backend * lib/WWW/Search/Ebay/IT.pm: new backend 2006-08-25 * lib/WWW/Search/Ebay/DE.pm: new backend * lib/WWW/Search/Ebay.pm (_process_date_abbrevs): new method (_result_count_regex): new method (_next_text): new method 2006-06-14 * lib/WWW/Search/Ebay.pm (parse_shipping): replace stub method with actual code! (as suggested by John Baleshiski 8-) 2006-04-22 * lib/WWW/Search/Ebay.pm (_bidamount_as_text): new private method (_bidcount_as_text): new private method (result_as_HTML): new method (parse_price): set sold() on results (as suggested by Nick Lokkju) (_parse_category_list): new private method 2006-04-21 * lib/WWW/Search/Ebay.pm (_bid_as_text): new method (result_as_HTML): new method 2006-03-22 * lib/WWW/Search/Ebay.pm (parse_tree): don't use the Switch module 2006-03-11 * lib/WWW/Search/Ebay.pm (parse_enddate): now can take a string argument 2006-02-18 * lib/WWW/Search/Ebay.pm (parse_tree): enhanced to parse Completed listings 2005-12-27 * lib/WWW/Search/Ebay/ByBidderID.pm: new backend! * lib/WWW/Search/Ebay.pm (parse_tree): use new item_number (et al.) attributes in SearchResult 2005-12-25 * lib/WWW/Search/Ebay.pm (parse_tree): now returns the item's category number 2005-08-29 * lib/WWW/Search/Ebay/Stores.pm (native_setup_search): fixed the CGI options 2005-08-27 * lib/WWW/Search/Ebay.pm (parse_tree): determine order of columns dynamically 2005-08-18 * lib/WWW/Search/Ebay/Stores.pm (columns): damn ebay.com changed the column order again * lib/WWW/Search/Ebay.pm (columns): damn ebay.com changed the column order again (parse_price): watch for running off the end of the Stores list * lib/WWW/Search/Ebay/BuyItNow.pm (columns): damn ebay.com changed the column order again 2005-08-16 * lib/WWW/Search/Ebay.pm: new flexible way of parsing table cells in a backend-specific order! * lib/WWW/Search/Ebay/BuyItNow.pm (columns): new method * lib/WWW/Search/Ebay/Motors.pm (columns): new method * lib/WWW/Search/Ebay/Stores.pm (columns): new method * lib/WWW/Search/Ebay/UK.pm (columns): new method 2005-08-14 * lib/WWW/Search/Ebay/BySellerID.pm: NEW BACKEND * t/bysellerid.t: new tests for the above * lib/WWW/Search/Ebay.pm (parse_tree): do not return results from auto-spell-checked query term * t/basic.t: added tests for the above 2005-08-07 * lib/WWW/Search/Ebay.pm (parse_tree): return URLs as simple old cgi arguments 2005-07-30 * lib/WWW/Search/Ebay/UK.pm (_result_count_td_specs_OLD): use parent class' value for this method * lib/WWW/Search/Ebay.pm (preprocess_results_page): fix title pattern 2005-07-29 * lib/WWW/Search/Ebay.pm (parse_tree): two fixes for new eBay page format 2005-06-11 Kingpin * lib/WWW/Search/Ebay/UK.pm (preprocess_results_page): new method (_title_td_specs): new specs (_result_count_td_specs): new specs * lib/WWW/Search/Ebay/Stores.pm (preprocess_results_page): new method 2005-06-10 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): added a hack to detect when a Stores search runs off the bottom of the list 2005-05-18 Kingpin * lib/WWW/Search/Ebay.pm (_result_count_td_specs): new method (_title_td_specs): new method (parse_tree): fixed parser for new webpage contents * lib/WWW/Search/Ebay/UK.pm (_result_count_td_specs): new method (_title_td_specs): new method 2005-02-28 Kingpin * lib/WWW/Search/Ebay/UK.pm (currency_pattern): clean up pattern 2005-01-25 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): call _create_description as a method 2005-01-23 Kingpin * lib/WWW/Search/Ebay.pm (_format_date): now a method, not just a function (_create_description): now a method, not just a function (_cleanup_url): new method 2004-11-29 Kingpin * lib/WWW/Search/Ebay/UK.pm: new file * t/uk.t: new file * lib/WWW/Search/Ebay.pm (native_setup_search): fix column order parsing for Ebay::UK 2004-11-27 Kingpin * lib/WWW/Search/Ebay.pm (_format_date): new function (_create_description): new function (parse_tree): detect redirection to single-auction page 2004-11-24 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): fetch eBay official time, and fix timezone conversion 2004-11-23 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): omit seconds from change_date value; do not set TZ if it's already in the environment 2004-11-05 Kingpin * t/motors.t: fix 1-page query 2004-10-25 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): handle default page format * lib/WWW/Search/Ebay/Stores.pm (native_setup_search): let parent object control the HTML page formatting params 2004-10-21 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): handle new HTML page format * lib/WWW/Search/Ebay/Stores.pm (native_setup_search): new CGI parameters parsing now handled by parent class 2004-09-25 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): now sets bid_count and bid_amount in the Result objects * lib/WWW/Search/Ebay/Motors.pm (native_setup_search): new backend! * t/motors.t: new test * lib/WWW/Search/Ebay.pm: added pod for how to search one category 2004-09-16 Kingpin * lib/WWW/Search/Ebay/ByEndDate.pm (date_to_rel): new function; (parse_tree): fix date sort; different date format in change_date; 2004-08-20 Kingpin * lib/WWW/Search/Ebay/BuyItNow.pm: new file * t/buyitnow.t (my_test): new file 2004-07-23 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): fix for parsing result count 2004-06-05 Kingpin * t/stores.t: new file * lib/WWW/Search/Ebay/Stores.pm: new file * lib/WWW/Search/Ebay.pm (currency_pattern): new function 2004-04-17 Kingpin * lib/WWW/Search/Ebay.pm (native_setup_search): new URL / CGI options (parse_tree): handle new HTML formatting 2004-04-08 Kingpin * lib/WWW/Search/Ebay/ByEndDate.pm (parse_tree): fix undef warning * lib/WWW/Search/Ebay.pm (parse_tree): handle new HTML formatting 2003-12-21 Kingpin * lib/WWW/Search/Ebay/Completed.pm: removed because searching completed auctions now requires registered user login * t/completed.t: removed because searching completed auctions now requires registered user login 2003-12-06 Kingpin * lib/WWW/Search/Ebay/ByEndDate.pm: fixed so that "featured" auctions are put into the properly sorted order 2003-11-13 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): in change_date, convert nbsp to regular space 2003-10-27 Kingpin * t/enddate.t: beefed-up tests * t/basic.t: separated test files * t/completed.t: beefed-up tests * lib/WWW/Search/Ebay.pm (native_setup_search): let the host and path be NON-generic args (thanks to Mike Schilli) 2003-07-13 Kingpin * lib/WWW/Search/Ebay/Completed.pm: new backend (thanks to Troy Arnold) 2003-02-06 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): Fixed parsing for slightly-changed ebay.com pages * test.pl: added some tests to actually look at the results 2002-10-22 Kingpin * lib/WWW/Search/Ebay/ByEndDate.pm (native_setup_search): Fixed hash vs. array bug? 2002-10-21 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): Fixed parsing for Buy-It-Now prices, and foreign currencies 2002-07-24 Kingpin * lib/WWW/Search/Ebay.pm (parse_tree): fix parsing around new images in table 2001-12-20 Kingpin * lib/WWW/Search/Ebay.pm (native_retrieve_some): handle new ebay.com output format (parse_tree): rewrite using this new method 2001-07-30 Kingpin * lib/WWW/Search/Ebay/ByEndDate.pm: new backend! 2001-06-26 Kingpin * VERSION 2.05 RELEASED 2001-06-25 Kingpin * Ebay.pm (native_retrieve_some): tweaks to prevent warnings / parse errors 2001-05-08 Kingpin * VERSION 2.04 RELEASED 2001-05-07 Kingpin * Ebay.pm (native_retrieve_some): updated for new output format 2001-04-21 Kingpin * VERSION 2.03 RELEASED 2001-04-20 Kingpin * Ebay.pm (native_retrieve_some): result->description now contains bid info 2001-04-14 Kingpin * VERSION 2.02 RELEASED 2001-04-13 Kingpin * Ebay.pm (native_setup_search): make the user_agent non-robot 2001-04-02 Kingpin * VERSION 2.01 RELEASED Revision history for Perl extension WWW::Search::Ebay WWW-Search-Ebay-3.042/LICENSE0000644000000000000000000010450612575303434014006 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {one line to give the program's name and a brief idea of what it does.} Copyright (C) {year} {name of author} This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: {project} Copyright (C) {year} {fullname} This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . WWW-Search-Ebay-3.042/inc/0000755000000000000000000000000012575327516013553 5ustar rootrootWWW-Search-Ebay-3.042/inc/Module/0000755000000000000000000000000012575327516015000 5ustar rootrootWWW-Search-Ebay-3.042/inc/Module/Install.pm0000644000000000000000000003021712575325664016751 0ustar rootroot#line 1 package Module::Install; # For any maintainers: # The load order for Module::Install is a bit magic. # It goes something like this... # # IF ( host has Module::Install installed, creating author mode ) { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install # 3. The installed version of inc::Module::Install loads # 4. inc::Module::Install calls "require Module::Install" # 5. The ./inc/ version of Module::Install loads # } ELSE { # 1. Makefile.PL calls "use inc::Module::Install" # 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install # 3. The ./inc/ version of Module::Install loads # } use 5.006; use strict 'vars'; use Cwd (); use File::Find (); use File::Path (); use vars qw{$VERSION $MAIN}; BEGIN { # All Module::Install core packages now require synchronised versions. # This will be used to ensure we don't accidentally load old or # different versions of modules. # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. $VERSION = '1.14'; # Storage for the pseudo-singleton $MAIN = undef; *inc::Module::Install::VERSION = *VERSION; @inc::Module::Install::ISA = __PACKAGE__; } sub import { my $class = shift; my $self = $class->new(@_); my $who = $self->_caller; #------------------------------------------------------------- # all of the following checks should be included in import(), # to allow "eval 'require Module::Install; 1' to test # installation of Module::Install. (RT #51267) #------------------------------------------------------------- # Whether or not inc::Module::Install is actually loaded, the # $INC{inc/Module/Install.pm} is what will still get set as long as # the caller loaded module this in the documented manner. # If not set, the caller may NOT have loaded the bundled version, and thus # they may not have a MI version that works with the Makefile.PL. This would # result in false errors or unexpected behaviour. And we don't want that. my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm'; unless ( $INC{$file} ) { die <<"END_DIE" } Please invoke ${\__PACKAGE__} with: use inc::${\__PACKAGE__}; not: use ${\__PACKAGE__}; END_DIE # This reportedly fixes a rare Win32 UTC file time issue, but # as this is a non-cross-platform XS module not in the core, # we shouldn't really depend on it. See RT #24194 for detail. # (Also, this module only supports Perl 5.6 and above). eval "use Win32::UTCFileTime" if $^O eq 'MSWin32' && $] >= 5.006; # If the script that is loading Module::Install is from the future, # then make will detect this and cause it to re-run over and over # again. This is bad. Rather than taking action to touch it (which # is unreliable on some platforms and requires write permissions) # for now we should catch this and refuse to run. if ( -f $0 ) { my $s = (stat($0))[9]; # If the modification time is only slightly in the future, # sleep briefly to remove the problem. my $a = $s - time; if ( $a > 0 and $a < 5 ) { sleep 5 } # Too far in the future, throw an error. my $t = time; if ( $s > $t ) { die <<"END_DIE" } Your installer $0 has a modification time in the future ($s > $t). This is known to create infinite loops in make. Please correct this, then run $0 again. END_DIE } # Build.PL was formerly supported, but no longer is due to excessive # difficulty in implementing every single feature twice. if ( $0 =~ /Build.PL$/i ) { die <<"END_DIE" } Module::Install no longer supports Build.PL. It was impossible to maintain duel backends, and has been deprecated. Please remove all Build.PL files and only use the Makefile.PL installer. END_DIE #------------------------------------------------------------- # To save some more typing in Module::Install installers, every... # use inc::Module::Install # ...also acts as an implicit use strict. $^H |= strict::bits(qw(refs subs vars)); #------------------------------------------------------------- unless ( -f $self->{file} ) { foreach my $key (keys %INC) { delete $INC{$key} if $key =~ /Module\/Install/; } local $^W; require "$self->{path}/$self->{dispatch}.pm"; File::Path::mkpath("$self->{prefix}/$self->{author}"); $self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self ); $self->{admin}->init; @_ = ($class, _self => $self); goto &{"$self->{name}::import"}; } local $^W; *{"${who}::AUTOLOAD"} = $self->autoload; $self->preload; # Unregister loader and worker packages so subdirs can use them again delete $INC{'inc/Module/Install.pm'}; delete $INC{'Module/Install.pm'}; # Save to the singleton $MAIN = $self; return 1; } sub autoload { my $self = shift; my $who = $self->_caller; my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; } unless ($$sym =~ s/([^:]+)$//) { # XXX: it looks like we can't retrieve the missing function # via $$sym (usually $main::AUTOLOAD) in this case. # I'm still wondering if we should slurp Makefile.PL to # get some context or not ... my ($package, $file, $line) = caller; die <<"EOT"; Unknown function is found at $file line $line. Execution of $file aborted due to runtime errors. If you're a contributor to a project, you may need to install some Module::Install extensions from CPAN (or other repository). If you're a user of a module, please contact the author. EOT } my $method = $1; if ( uc($method) eq $method ) { # Do nothing return; } elsif ( $method =~ /^_/ and $self->can($method) ) { # Dispatch to the root M:I class return $self->$method(@_); } # Dispatch to the appropriate plugin unshift @_, ( $self, $1 ); goto &{$self->can('call')}; }; } sub preload { my $self = shift; unless ( $self->{extensions} ) { $self->load_extensions( "$self->{prefix}/$self->{path}", $self ); } my @exts = @{$self->{extensions}}; unless ( @exts ) { @exts = $self->{admin}->load_all_extensions; } my %seen; foreach my $obj ( @exts ) { while (my ($method, $glob) = each %{ref($obj) . '::'}) { next unless $obj->can($method); next if $method =~ /^_/; next if $method eq uc($method); $seen{$method}++; } } my $who = $self->_caller; foreach my $name ( sort keys %seen ) { local $^W; *{"${who}::$name"} = sub { ${"${who}::AUTOLOAD"} = "${who}::$name"; goto &{"${who}::AUTOLOAD"}; }; } } sub new { my ($class, %args) = @_; delete $INC{'FindBin.pm'}; { # to suppress the redefine warning local $SIG{__WARN__} = sub {}; require FindBin; } # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; $args{dispatch} ||= 'Admin'; $args{prefix} ||= 'inc'; $args{author} ||= ($^O eq 'VMS' ? '_author' : '.author'); $args{bundle} ||= 'inc/BUNDLES'; $args{base} ||= $base_path; $class =~ s/^\Q$args{prefix}\E:://; $args{name} ||= $class; $args{version} ||= $class->VERSION; unless ( $args{path} ) { $args{path} = $args{name}; $args{path} =~ s!::!/!g; } $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm"; $args{wrote} = 0; bless( \%args, $class ); } sub call { my ($self, $method) = @_; my $obj = $self->load($method) or return; splice(@_, 0, 2, $obj); goto &{$obj->can($method)}; } sub load { my ($self, $method) = @_; $self->load_extensions( "$self->{prefix}/$self->{path}", $self ) unless $self->{extensions}; foreach my $obj (@{$self->{extensions}}) { return $obj if $obj->can($method); } my $admin = $self->{admin} or die <<"END_DIE"; The '$method' method does not exist in the '$self->{prefix}' path! Please remove the '$self->{prefix}' directory and run $0 again to load it. END_DIE my $obj = $admin->load($method, 1); push @{$self->{extensions}}, $obj; $obj; } sub load_extensions { my ($self, $path, $top) = @_; my $should_reload = 0; unless ( grep { ! ref $_ and lc $_ eq lc $self->{prefix} } @INC ) { unshift @INC, $self->{prefix}; $should_reload = 1; } foreach my $rv ( $self->find_extensions($path) ) { my ($file, $pkg) = @{$rv}; next if $self->{pathnames}{$pkg}; local $@; my $new = eval { local $^W; require $file; $pkg->can('new') }; unless ( $new ) { warn $@ if $@; next; } $self->{pathnames}{$pkg} = $should_reload ? delete $INC{$file} : $INC{$file}; push @{$self->{extensions}}, &{$new}($pkg, _top => $top ); } $self->{extensions} ||= []; } sub find_extensions { my ($self, $path) = @_; my @found; File::Find::find( sub { my $file = $File::Find::name; return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is; my $subpath = $1; return if lc($subpath) eq lc($self->{dispatch}); $file = "$self->{path}/$subpath.pm"; my $pkg = "$self->{name}::$subpath"; $pkg =~ s!/!::!g; # If we have a mixed-case package name, assume case has been preserved # correctly. Otherwise, root through the file to locate the case-preserved # version of the package name. if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text next if /^\s*#/; # and comments if ( m/^\s*package\s+($pkg)\s*;/i ) { $pkg = $1; last; } } } push @found, [ $file, $pkg ]; }, $path ) if -d $path; @found; } ##################################################################### # Common Utility Functions sub _caller { my $depth = 0; my $call = caller($depth); while ( $call eq __PACKAGE__ ) { $depth++; $call = caller($depth); } return $call; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_NEW sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; } END_OLD sub _readperl { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; $string =~ s/(\n)\n*__(?:DATA|END)__\b.*\z/$1/s; $string =~ s/\n\n=\w+.+?\n\n=cut\b.+?\n+/\n\n/sg; return $string; } sub _readpod { my $string = Module::Install::_read($_[0]); $string =~ s/(?:\015{1,2}\012|\015|\012)/\n/sg; return $string if $_[0] =~ /\.pod\z/; $string =~ s/(^|\n=cut\b.+?\n+)[^=\s].+?\n(\n=\w+|\z)/$1$2/sg; $string =~ s/\n*=pod\b[^\n]*\n+/\n\n/sg; $string =~ s/\n*=cut\b[^\n]*\n+/\n\n/sg; $string =~ s/^\n+//s; return $string; } # Done in evals to avoid confusing Perl::MinimumVersion eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@; sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_NEW sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } close FH or die "close($_[0]): $!"; } END_OLD # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { # Normalise multipart versions $s =~ s/(\.)(\d{1,3})/sprintf("$1%03d",$2)/eg; } $s =~ s/^(\d+)\.?//; my $l = $1 || 0; my @v = map { $_ . '0' x (3 - length $_) } $s =~ /(\d{1,3})\D?/g; $l = $l . '.' . join '', @v if @v; return $l + 0; } sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS sub _CLASS { ( defined $_[0] and ! ref $_[0] and $_[0] =~ m/^[^\W\d]\w*(?:::\w+)*\z/s ) ? $_[0] : undef; } 1; # Copyright 2008 - 2012 Adam Kennedy. WWW-Search-Ebay-3.042/inc/Module/Install/0000755000000000000000000000000012575327516016406 5ustar rootrootWWW-Search-Ebay-3.042/inc/Module/Install/Can.pm0000644000000000000000000000615712575325670017455 0ustar rootroot#line 1 package Module::Install::Can; use strict; use Config (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # check if we can load some module ### Upgrade this to not have to load the module if possible sub can_use { my ($self, $mod, $ver) = @_; $mod =~ s{::|\\}{/}g; $mod .= '.pm' unless $mod =~ /\.pm$/i; my $pkg = $mod; $pkg =~ s{/}{::}g; $pkg =~ s{\.pm$}{}i; local $@; eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } # Check if we can run some command sub can_run { my ($self, $cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; require File::Spec; my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Can our C compiler environment build XS files sub can_xs { my $self = shift; # Ensure we have the CBuilder module $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); # Do we have the configure_requires checker? local $@; eval "require ExtUtils::CBuilder;"; if ( $@ ) { # They don't obey configure_requires, so it is # someone old and delicate. Try to avoid hurting # them by falling back to an older simpler test. return $self->can_cc(); } # Do we have a working C compiler my $builder = ExtUtils::CBuilder->new( quiet => 1, ); unless ( $builder->have_compiler ) { # No working C compiler return 0; } # Write a C file representative of what XS becomes require File::Temp; my ( $FH, $tmpfile ) = File::Temp::tempfile( "compilexs-XXXXX", SUFFIX => '.c', ); binmode $FH; print $FH <<'END_C'; #include "EXTERN.h" #include "perl.h" #include "XSUB.h" int main(int argc, char **argv) { return 0; } int boot_sanexs() { return 1; } END_C close $FH; # Can the C compiler access the same headers XS does my @libs = (); my $object = undef; eval { local $^W = 0; $object = $builder->compile( source => $tmpfile, ); @libs = $builder->link( objects => $object, module_name => 'sanexs', ); }; my $result = $@ ? 0 : 1; # Clean up all the build files foreach ( $tmpfile, $object, @libs ) { next unless defined $_; 1 while unlink; } return $result; } # Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; # $Config{cc} may contain args; try to find out the program part while (@chunks) { return $self->can_run("@chunks") || (pop(@chunks), next); } return; } # Fix Cygwin bug on maybe_command(); if ( $^O eq 'cygwin' ) { require ExtUtils::MM_Cygwin; require ExtUtils::MM_Win32; if ( ! defined(&ExtUtils::MM_Cygwin::maybe_command) ) { *ExtUtils::MM_Cygwin::maybe_command = sub { my ($self, $file) = @_; if ($file =~ m{^/cygdrive/}i and ExtUtils::MM_Win32->can('maybe_command')) { ExtUtils::MM_Win32->maybe_command($file); } else { ExtUtils::MM_Unix->maybe_command($file); } } } } 1; __END__ #line 236 WWW-Search-Ebay-3.042/inc/Module/Install/Win32.pm0000644000000000000000000000340312575325670017645 0ustar rootroot#line 1 package Module::Install::Win32; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } # determine if the user needs nmake, and download it if needed sub check_nmake { my $self = shift; $self->load('can_run'); $self->load('get_file'); require Config; return unless ( $^O eq 'MSWin32' and $Config::Config{make} and $Config::Config{make} =~ /^nmake\b/i and ! $self->can_run('nmake') ); print "The required 'nmake' executable not found, fetching it...\n"; require File::Basename; my $rv = $self->get_file( url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe', ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe', local_dir => File::Basename::dirname($^X), size => 51928, run => 'Nmake15.exe /o > nul', check_for => 'Nmake.exe', remove => 1, ); die <<'END_MESSAGE' unless $rv; ------------------------------------------------------------------------------- Since you are using Microsoft Windows, you will need the 'nmake' utility before installation. It's available at: http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe or ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe Please download the file manually, save it to a directory in %PATH% (e.g. C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to that directory, and run "Nmake15.exe" from there; that will create the 'nmake.exe' file needed by this module. You may then resume the installation process described in README. ------------------------------------------------------------------------------- END_MESSAGE } 1; WWW-Search-Ebay-3.042/inc/Module/Install/PerlTar.pm0000644000000000000000000000222112575325667020317 0ustar rootroot#line 1 package Module::Install::PerlTar; use 5.006001; use strict; use warnings; use Module::Install::Base (); our @ISA = qw(Module::Install::Base); our $VERSION = '1.001'; $VERSION =~ s/_//ms; sub use_ptar { my $self = shift; # warn " DDD start use_ptar(), WWW Module::Install::AUTHOR is =$Module::Install::AUTHOR=\n"; # Martin if (! $Module::Install::AUTHOR) { warn " WWW bailing because Module::Install::AUTHOR is not set\n"; # Martin return; } eval { require Archive::Tar; 1; } or warn "Cannot find Archive::Tar\n"; eval { require IO::Compress::Gzip; 1; } or warn "Cannot find IO::Compress::Gzip\n"; my %args = ( TAR => 'ptar', TARFLAGS => 'cf', COMPRESS => q{perl -MIO::Compress::Gzip=gzip,:constants -e"my $$in = $$ARGV[0]; gzip($$in => qq($$in.gz), q(Level) => Z_BEST_COMPRESSION, q(BinModeIn) => 1) or die q(gzip failed); unlink $$in;"}, ); # use Data::Dumper; # Martin # warn " DDD adding the following to makemaker_args: ", Dumper(\%args); # Martin $self->makemaker_args( dist => \%args ); return 1; } ## end sub use_ptar 1; __END__ =encoding utf-8 #line 75 WWW-Search-Ebay-3.042/inc/Module/Install/Base.pm0000644000000000000000000000214712575325667017627 0ustar rootroot#line 1 package Module::Install::Base; use strict 'vars'; use vars qw{$VERSION}; BEGIN { $VERSION = '1.14'; } # Suspend handler for "redefined" warnings BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w }; } #line 42 sub new { my $class = shift; unless ( defined &{"${class}::call"} ) { *{"${class}::call"} = sub { shift->_top->call(@_) }; } unless ( defined &{"${class}::load"} ) { *{"${class}::load"} = sub { shift->_top->load(@_) }; } bless { @_ }, $class; } #line 61 sub AUTOLOAD { local $@; my $func = eval { shift->_top->autoload } or return; goto &$func; } #line 75 sub _top { $_[0]->{_top}; } #line 90 sub admin { $_[0]->_top->{admin} or Module::Install::Base::FakeAdmin->new; } #line 106 sub is_admin { ! $_[0]->admin->isa('Module::Install::Base::FakeAdmin'); } sub DESTROY {} package Module::Install::Base::FakeAdmin; use vars qw{$VERSION}; BEGIN { $VERSION = $Module::Install::Base::VERSION; } my $fake; sub new { $fake ||= bless(\@_, $_[0]); } sub AUTOLOAD {} sub DESTROY {} # Restore warning handler BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->(); } 1; #line 159 WWW-Search-Ebay-3.042/inc/Module/Install/WriteAll.pm0000644000000000000000000000237612575325670020476 0ustar rootroot#line 1 package Module::Install::WriteAll; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } sub WriteAll { my $self = shift; my %args = ( meta => 1, sign => 0, inline => 0, check_nmake => 1, @_, ); $self->sign(1) if $args{sign}; $self->admin->WriteAll(%args) if $self->is_admin; $self->check_nmake if $args{check_nmake}; unless ( $self->makemaker_args->{PL_FILES} ) { # XXX: This still may be a bit over-defensive... unless ($self->makemaker(6.25)) { $self->makemaker_args( PL_FILES => {} ) if -f 'Build.PL'; } } # Until ExtUtils::MakeMaker support MYMETA.yml, make sure # we clean it up properly ourself. $self->realclean_files('MYMETA.yml'); if ( $args{inline} ) { $self->Inline->write; } else { $self->Makefile->write; } # The Makefile write process adds a couple of dependencies, # so write the META.yml files after the Makefile. if ( $args{meta} ) { $self->Meta->write; } # Experimental support for MYMETA if ( $ENV{X_MYMETA} ) { if ( $ENV{X_MYMETA} eq 'JSON' ) { $self->Meta->write_mymeta_json; } else { $self->Meta->write_mymeta_yaml; } } return 1; } 1; WWW-Search-Ebay-3.042/inc/Module/Install/AuthorTests.pm0000644000000000000000000000221512575325667021236 0ustar rootroot#line 1 package Module::Install::AuthorTests; use 5.005; use strict; use Module::Install::Base; use Carp (); #line 16 use vars qw{$VERSION $ISCORE @ISA}; BEGIN { $VERSION = '0.002'; $ISCORE = 1; @ISA = qw{Module::Install::Base}; } #line 42 sub author_tests { my ($self, @dirs) = @_; _add_author_tests($self, \@dirs, 0); } #line 56 sub recursive_author_tests { my ($self, @dirs) = @_; _add_author_tests($self, \@dirs, 1); } sub _wanted { my $href = shift; sub { /\.t$/ and -f $_ and $href->{$File::Find::dir} = 1 } } sub _add_author_tests { my ($self, $dirs, $recurse) = @_; return unless $Module::Install::AUTHOR; my @tests = $self->tests ? (split / /, $self->tests) : 't/*.t'; # XXX: pick a default, later -- rjbs, 2008-02-24 my @dirs = @$dirs ? @$dirs : Carp::confess "no dirs given to author_tests"; @dirs = grep { -d } @dirs; if ($recurse) { require File::Find; my %test_dir; File::Find::find(_wanted(\%test_dir), @dirs); $self->tests( join ' ', @tests, map { "$_/*.t" } sort keys %test_dir ); } else { $self->tests( join ' ', @tests, map { "$_/*.t" } sort @dirs ); } } #line 107 1; WWW-Search-Ebay-3.042/inc/Module/Install/Fetch.pm0000644000000000000000000000462712575325670020005 0ustar rootroot#line 1 package Module::Install::Fetch; use strict; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub get_file { my ($self, %args) = @_; my ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) { $args{url} = $args{ftp_url} or (warn("LWP support unavailable!\n"), return); ($scheme, $host, $path, $file) = $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return; } $|++; print "Fetching '$file' from $host... "; unless (eval { require Socket; Socket::inet_aton($host) }) { warn "'$host' resolve failed!\n"; return; } return unless $scheme eq 'ftp' or $scheme eq 'http'; require Cwd; my $dir = Cwd::getcwd(); chdir $args{local_dir} or return if exists $args{local_dir}; if (eval { require LWP::Simple; 1 }) { LWP::Simple::mirror($args{url}, $file); } elsif (eval { require Net::FTP; 1 }) { eval { # use Net::FTP to get past firewall my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600); $ftp->login("anonymous", 'anonymous@example.com'); $ftp->cwd($path); $ftp->binary; $ftp->get($file) or (warn("$!\n"), return); $ftp->quit; } } elsif (my $ftp = $self->can_run('ftp')) { eval { # no Net::FTP, fallback to ftp.exe require FileHandle; my $fh = FileHandle->new; local $SIG{CHLD} = 'IGNORE'; unless ($fh->open("|$ftp -n")) { warn "Couldn't open ftp: $!\n"; chdir $dir; return; } my @dialog = split(/\n/, <<"END_FTP"); open $host user anonymous anonymous\@example.com cd $path binary get $file $file quit END_FTP foreach (@dialog) { $fh->print("$_\n") } $fh->close; } } else { warn "No working 'ftp' program available!\n"; chdir $dir; return; } unless (-f $file) { warn "Fetching failed: $@\n"; chdir $dir; return; } return if exists $args{size} and -s $file != $args{size}; system($args{run}) if exists $args{run}; unlink($file) if $args{remove}; print(((!exists $args{check_for} or -e $args{check_for}) ? "done!" : "failed! ($!)"), "\n"); chdir $dir; return !$?; } 1; WWW-Search-Ebay-3.042/inc/Module/Install/Makefile.pm0000644000000000000000000002743712575325667020503 0ustar rootroot#line 1 package Module::Install::Makefile; use strict 'vars'; use ExtUtils::MakeMaker (); use Module::Install::Base (); use Fcntl qw/:flock :seek/; use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } sub Makefile { $_[0] } my %seen = (); sub prompt { shift; # Infinite loop protection my @c = caller(); if ( ++$seen{"$c[1]|$c[2]|$_[0]"} > 3 ) { die "Caught an potential prompt infinite loop ($c[1]|$c[2]|$_[0])"; } # In automated testing or non-interactive session, always use defaults if ( ($ENV{AUTOMATED_TESTING} or -! -t STDIN) and ! $ENV{PERL_MM_USE_DEFAULT} ) { local $ENV{PERL_MM_USE_DEFAULT} = 1; goto &ExtUtils::MakeMaker::prompt; } else { goto &ExtUtils::MakeMaker::prompt; } } # Store a cleaned up version of the MakeMaker version, # since we need to behave differently in a variety of # ways based on the MM version. my $makemaker = eval $ExtUtils::MakeMaker::VERSION; # If we are passed a param, do a "newer than" comparison. # Otherwise, just return the MakeMaker version. sub makemaker { ( @_ < 2 or $makemaker >= eval($_[1]) ) ? $makemaker : 0 } # Ripped from ExtUtils::MakeMaker 6.56, and slightly modified # as we only need to know here whether the attribute is an array # or a hash or something else (which may or may not be appendable). my %makemaker_argtype = ( C => 'ARRAY', CONFIG => 'ARRAY', # CONFIGURE => 'CODE', # ignore DIR => 'ARRAY', DL_FUNCS => 'HASH', DL_VARS => 'ARRAY', EXCLUDE_EXT => 'ARRAY', EXE_FILES => 'ARRAY', FUNCLIST => 'ARRAY', H => 'ARRAY', IMPORTS => 'HASH', INCLUDE_EXT => 'ARRAY', LIBS => 'ARRAY', # ignore '' MAN1PODS => 'HASH', MAN3PODS => 'HASH', META_ADD => 'HASH', META_MERGE => 'HASH', PL_FILES => 'HASH', PM => 'HASH', PMLIBDIRS => 'ARRAY', PMLIBPARENTDIRS => 'ARRAY', PREREQ_PM => 'HASH', CONFIGURE_REQUIRES => 'HASH', SKIP => 'ARRAY', TYPEMAPS => 'ARRAY', XS => 'HASH', # VERSION => ['version',''], # ignore # _KEEP_AFTER_FLUSH => '', clean => 'HASH', depend => 'HASH', dist => 'HASH', dynamic_lib=> 'HASH', linkext => 'HASH', macro => 'HASH', postamble => 'HASH', realclean => 'HASH', test => 'HASH', tool_autosplit => 'HASH', # special cases where you can use makemaker_append CCFLAGS => 'APPENDABLE', DEFINE => 'APPENDABLE', INC => 'APPENDABLE', LDDLFLAGS => 'APPENDABLE', LDFROM => 'APPENDABLE', ); sub makemaker_args { my ($self, %new_args) = @_; my $args = ( $self->{makemaker_args} ||= {} ); foreach my $key (keys %new_args) { if ($makemaker_argtype{$key}) { if ($makemaker_argtype{$key} eq 'ARRAY') { $args->{$key} = [] unless defined $args->{$key}; unless (ref $args->{$key} eq 'ARRAY') { $args->{$key} = [$args->{$key}] } push @{$args->{$key}}, ref $new_args{$key} eq 'ARRAY' ? @{$new_args{$key}} : $new_args{$key}; } elsif ($makemaker_argtype{$key} eq 'HASH') { $args->{$key} = {} unless defined $args->{$key}; foreach my $skey (keys %{ $new_args{$key} }) { $args->{$key}{$skey} = $new_args{$key}{$skey}; } } elsif ($makemaker_argtype{$key} eq 'APPENDABLE') { $self->makemaker_append($key => $new_args{$key}); } } else { if (defined $args->{$key}) { warn qq{MakeMaker attribute "$key" is overriden; use "makemaker_append" to append values\n}; } $args->{$key} = $new_args{$key}; } } return $args; } # For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; my $name = shift; my $args = $self->makemaker_args; $args->{$name} = defined $args->{$name} ? join( ' ', $args->{$name}, @_ ) : join( ' ', @_ ); } sub build_subdirs { my $self = shift; my $subdirs = $self->makemaker_args->{DIR} ||= []; for my $subdir (@_) { push @$subdirs, $subdir; } } sub clean_files { my $self = shift; my $clean = $self->makemaker_args->{clean} ||= {}; %$clean = ( %$clean, FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_), ); } sub realclean_files { my $self = shift; my $realclean = $self->makemaker_args->{realclean} ||= {}; %$realclean = ( %$realclean, FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_), ); } sub libs { my $self = shift; my $libs = ref $_[0] ? shift : [ shift ]; $self->makemaker_args( LIBS => $libs ); } sub inc { my $self = shift; $self->makemaker_args( INC => shift ); } sub _wanted_t { } sub tests_recursive { my $self = shift; my $dir = shift || 't'; unless ( -d $dir ) { die "tests_recursive dir '$dir' does not exist"; } my %tests = map { $_ => 1 } split / /, ($self->tests || ''); require File::Find; File::Find::find( sub { /\.t$/ and -f $_ and $tests{"$File::Find::dir/*.t"} = 1 }, $dir ); $self->tests( join ' ', sort keys %tests ); } sub write { my $self = shift; die "&Makefile->write() takes no arguments\n" if @_; # Check the current Perl version my $perl_version = $self->perl_version; if ( $perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; } # Make sure we have a new enough MakeMaker require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { # This previous attempted to inherit the version of # ExtUtils::MakeMaker in use by the module author, but this # was found to be untenable as some authors build releases # using future dev versions of EU:MM that nobody else has. # Instead, #toolchain suggests we use 6.59 which is the most # stable version on CPAN at time of writing and is, to quote # ribasushi, "not terminally fucked, > and tested enough". # TODO: We will now need to maintain this over time to push # the version up as new versions are released. $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. $self->build_requires( 'ExtUtils::MakeMaker' => 6.36 ); $self->configure_requires( 'ExtUtils::MakeMaker' => 6.36 ); } # Generate the MakeMaker params my $args = $self->makemaker_args; $args->{DISTNAME} = $self->name; $args->{NAME} = $self->module_name || $self->name; $args->{NAME} =~ s/-/::/g; $args->{VERSION} = $self->version or die <<'EOT'; ERROR: Can't determine distribution version. Please specify it explicitly via 'version' in Makefile.PL, or set a valid $VERSION in a module, and provide its file path via 'version_from' (or 'all_from' if you prefer) in Makefile.PL. EOT if ( $self->tests ) { my @tests = split ' ', $self->tests; my %seen; $args->{test} = { TESTS => (join ' ', grep {!$seen{$_}++} @tests), }; } elsif ( $Module::Install::ExtraTests::use_extratests ) { # Module::Install::ExtraTests doesn't set $self->tests and does its own tests via harness. # So, just ignore our xt tests here. } elsif ( -d 'xt' and ($Module::Install::AUTHOR or $ENV{RELEASE_TESTING}) ) { $args->{test} = { TESTS => join( ' ', map { "$_/*.t" } grep { -d $_ } qw{ t xt } ), }; } if ( $] >= 5.005 ) { $args->{ABSTRACT} = $self->abstract; $args->{AUTHOR} = join ', ', @{$self->author || []}; } if ( $self->makemaker(6.10) ) { $args->{NO_META} = 1; #$args->{NO_MYMETA} = 1; } if ( $self->makemaker(6.17) and $self->sign ) { $args->{SIGN} = 1; } unless ( $self->is_admin ) { delete $args->{SIGN}; } if ( $self->makemaker(6.31) and $self->license ) { $args->{LICENSE} = $self->license; } my $prereq = ($args->{PREREQ_PM} ||= {}); %$prereq = ( %$prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->requires) ); # Remove any reference to perl, PREREQ_PM doesn't support it delete $args->{PREREQ_PM}->{perl}; # Merge both kinds of requires into BUILD_REQUIRES my $build_prereq = ($args->{BUILD_REQUIRES} ||= {}); %$build_prereq = ( %$build_prereq, map { @$_ } # flatten [module => version] map { @$_ } grep $_, ($self->configure_requires, $self->build_requires) ); # Remove any reference to perl, BUILD_REQUIRES doesn't support it delete $args->{BUILD_REQUIRES}->{perl}; # Delete bundled dists from prereq_pm, add it to Makefile DIR my $subdirs = ($args->{DIR} || []); if ($self->bundles) { my %processed; foreach my $bundle (@{ $self->bundles }) { my ($mod_name, $dist_dir) = @$bundle; delete $prereq->{$mod_name}; $dist_dir = File::Basename::basename($dist_dir); # dir for building this module if (not exists $processed{$dist_dir}) { if (-d $dist_dir) { # List as sub-directory to be processed by make push @$subdirs, $dist_dir; } # Else do nothing: the module is already present on the system $processed{$dist_dir} = undef; } } } unless ( $self->makemaker('6.55_03') ) { %$prereq = (%$prereq,%$build_prereq); delete $args->{BUILD_REQUIRES}; } if ( my $perl_version = $self->perl_version ) { eval "use $perl_version; 1" or die "ERROR: perl: Version $] is installed, " . "but we need version >= $perl_version"; if ( $self->makemaker(6.48) ) { $args->{MIN_PERL_VERSION} = $perl_version; } } if ($self->installdirs) { warn qq{old INSTALLDIRS (probably set by makemaker_args) is overriden by installdirs\n} if $args->{INSTALLDIRS}; $args->{INSTALLDIRS} = $self->installdirs; } my %args = map { ( $_ => $args->{$_} ) } grep {defined($args->{$_} ) } keys %$args; my $user_preop = delete $args{dist}->{PREOP}; if ( my $preop = $self->admin->preop($user_preop) ) { foreach my $key ( keys %$preop ) { $args{dist}->{$key} = $preop->{$key}; } } my $mm = ExtUtils::MakeMaker::WriteMakefile(%args); $self->fix_up_makefile($mm->{FIRST_MAKEFILE} || 'Makefile'); } sub fix_up_makefile { my $self = shift; my $makefile_name = shift; my $top_class = ref($self->_top) || ''; my $top_version = $self->_top->VERSION || ''; my $preamble = $self->preamble ? "# Preamble by $top_class $top_version\n" . $self->preamble : ''; my $postamble = "# Postamble by $top_class $top_version\n" . ($self->postamble || ''); local *MAKEFILE; open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!"; eval { flock MAKEFILE, LOCK_EX }; my $makefile = do { local $/; }; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; # Module::Install will never be used to build the Core Perl # Sometimes PERL_LIB and PERL_ARCHLIB get written anyway, which breaks # PREFIX/PERL5LIB, and thus, install_share. Blank them if they exist $makefile =~ s/^PERL_LIB = .+/PERL_LIB =/m; #$makefile =~ s/^PERL_ARCHLIB = .+/PERL_ARCHLIB =/m; # Perl 5.005 mentions PERL_LIB explicitly, so we have to remove that as well. $makefile =~ s/(\"?)-I\$\(PERL_LIB\)\1//g; # XXX - This is currently unused; not sure if it breaks other MM-users # $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg; seek MAKEFILE, 0, SEEK_SET; truncate MAKEFILE, 0; print MAKEFILE "$preamble$makefile$postamble" or die $!; close MAKEFILE or die $!; 1; } sub preamble { my ($self, $text) = @_; $self->{preamble} = $text . $self->{preamble} if defined $text; $self->{preamble}; } sub postamble { my ($self, $text) = @_; $self->{postamble} ||= $self->admin->postamble; $self->{postamble} .= $text if defined $text; $self->{postamble} } 1; __END__ #line 544 WWW-Search-Ebay-3.042/inc/Module/Install/Metadata.pm0000644000000000000000000004330212575325667020473 0ustar rootroot#line 1 package Module::Install::Metadata; use strict 'vars'; use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { $VERSION = '1.14'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } my @boolean_keys = qw{ sign }; my @scalar_keys = qw{ name module_name abstract version distribution_type tests installdirs }; my @tuple_keys = qw{ configure_requires build_requires requires recommends bundles resources }; my @resource_keys = qw{ homepage bugtracker repository }; my @array_keys = qw{ keywords author }; *authors = \&author; sub Meta { shift } sub Meta_BooleanKeys { @boolean_keys } sub Meta_ScalarKeys { @scalar_keys } sub Meta_TupleKeys { @tuple_keys } sub Meta_ResourceKeys { @resource_keys } sub Meta_ArrayKeys { @array_keys } foreach my $key ( @boolean_keys ) { *$key = sub { my $self = shift; if ( defined wantarray and not @_ ) { return $self->{values}->{$key}; } $self->{values}->{$key} = ( @_ ? $_[0] : 1 ); return $self; }; } foreach my $key ( @scalar_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} = shift; return $self; }; } foreach my $key ( @array_keys ) { *$key = sub { my $self = shift; return $self->{values}->{$key} if defined wantarray and !@_; $self->{values}->{$key} ||= []; push @{$self->{values}->{$key}}, @_; return $self; }; } foreach my $key ( @resource_keys ) { *$key = sub { my $self = shift; unless ( @_ ) { return () unless $self->{values}->{resources}; return map { $_->[1] } grep { $_->[0] eq $key } @{ $self->{values}->{resources} }; } return $self->{values}->{resources}->{$key} unless @_; my $uri = shift or die( "Did not provide a value to $key()" ); $self->resources( $key => $uri ); return 1; }; } foreach my $key ( grep { $_ ne "resources" } @tuple_keys) { *$key = sub { my $self = shift; return $self->{values}->{$key} unless @_; my @added; while ( @_ ) { my $module = shift or last; my $version = shift || 0; push @added, [ $module, $version ]; } push @{ $self->{values}->{$key} }, @added; return map {@$_} @added; }; } # Resource handling my %lc_resource = map { $_ => 1 } qw{ homepage license bugtracker repository }; sub resources { my $self = shift; while ( @_ ) { my $name = shift or last; my $value = shift or next; if ( $name eq lc $name and ! $lc_resource{$name} ) { die("Unsupported reserved lowercase resource '$name'"); } $self->{values}->{resources} ||= []; push @{ $self->{values}->{resources} }, [ $name, $value ]; } $self->{values}->{resources}; } # Aliases for build_requires that will have alternative # meanings in some future version of META.yml. sub test_requires { shift->build_requires(@_) } sub install_requires { shift->build_requires(@_) } # Aliases for installdirs options sub install_as_core { $_[0]->installdirs('perl') } sub install_as_cpan { $_[0]->installdirs('site') } sub install_as_site { $_[0]->installdirs('site') } sub install_as_vendor { $_[0]->installdirs('vendor') } sub dynamic_config { my $self = shift; my $value = @_ ? shift : 1; if ( $self->{values}->{dynamic_config} ) { # Once dynamic we never change to static, for safety return 0; } $self->{values}->{dynamic_config} = $value ? 1 : 0; return 1; } # Convenience command sub static_config { shift->dynamic_config(0); } sub perl_version { my $self = shift; return $self->{values}->{perl_version} unless @_; my $version = shift or die( "Did not provide a value to perl_version()" ); # Normalize the version $version = $self->_perl_version($version); # We don't support the really old versions unless ( $version >= 5.005 ) { die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n"; } $self->{values}->{perl_version} = $version; } sub all_from { my ( $self, $file ) = @_; unless ( defined($file) ) { my $name = $self->name or die( "all_from called with no args without setting name() first" ); $file = join('/', 'lib', split(/-/, $name)) . '.pm'; $file =~ s{.*/}{} unless -e $file; unless ( -e $file ) { die("all_from cannot find $file from $name"); } } unless ( -f $file ) { die("The path '$file' does not exist, or is not a file"); } $self->{values}{all_from} = $file; # Some methods pull from POD instead of code. # If there is a matching .pod, use that instead my $pod = $file; $pod =~ s/\.pm$/.pod/i; $pod = $file unless -e $pod; # Pull the different values $self->name_from($file) unless $self->name; $self->version_from($file) unless $self->version; $self->perl_version_from($file) unless $self->perl_version; $self->author_from($pod) unless @{$self->author || []}; $self->license_from($pod) unless $self->license; $self->abstract_from($pod) unless $self->abstract; return 1; } sub provides { my $self = shift; my $provides = ( $self->{values}->{provides} ||= {} ); %$provides = (%$provides, @_) if @_; return $provides; } sub auto_provides { my $self = shift; return $self unless $self->is_admin; unless (-e 'MANIFEST') { warn "Cannot deduce auto_provides without a MANIFEST, skipping\n"; return $self; } # Avoid spurious warnings as we are not checking manifest here. local $SIG{__WARN__} = sub {1}; require ExtUtils::Manifest; local *ExtUtils::Manifest::manicheck = sub { return }; require Module::Build; my $build = Module::Build->new( dist_name => $self->name, dist_version => $self->version, license => $self->license, ); $self->provides( %{ $build->find_dist_packages || {} } ); } sub feature { my $self = shift; my $name = shift; my $features = ( $self->{values}->{features} ||= [] ); my $mods; if ( @_ == 1 and ref( $_[0] ) ) { # The user used ->feature like ->features by passing in the second # argument as a reference. Accomodate for that. $mods = $_[0]; } else { $mods = \@_; } my $count = 0; push @$features, ( $name => [ map { ref($_) ? ( ref($_) eq 'HASH' ) ? %$_ : @$_ : $_ } @$mods ] ); return @$features; } sub features { my $self = shift; while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) { $self->feature( $name, @$mods ); } return $self->{values}->{features} ? @{ $self->{values}->{features} } : (); } sub no_index { my $self = shift; my $type = shift; push @{ $self->{values}->{no_index}->{$type} }, @_ if $type; return $self->{values}->{no_index}; } sub read { my $self = shift; $self->include_deps( 'YAML::Tiny', 0 ); require YAML::Tiny; my $data = YAML::Tiny::LoadFile('META.yml'); # Call methods explicitly in case user has already set some values. while ( my ( $key, $value ) = each %$data ) { next unless $self->can($key); if ( ref $value eq 'HASH' ) { while ( my ( $module, $version ) = each %$value ) { $self->can($key)->($self, $module => $version ); } } else { $self->can($key)->($self, $value); } } return $self; } sub write { my $self = shift; return $self unless $self->is_admin; $self->admin->write_meta; return $self; } sub version_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->version( ExtUtils::MM_Unix->parse_version($file) ); # for version integrity check $self->makemaker_args( VERSION_FROM => $file ); } sub abstract_from { require ExtUtils::MM_Unix; my ( $self, $file ) = @_; $self->abstract( bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix' )->parse_abstract($file) ); } # Add both distribution and module name sub name_from { my ($self, $file) = @_; if ( Module::Install::_read($file) =~ m/ ^ \s* package \s* ([\w:]+) [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); $name =~ s{::}{-}g; $self->name($name); unless ( $self->module_name ) { $self->module_name($module_name); } } else { die("Cannot determine name from $file\n"); } } sub _extract_perl_version { if ( $_[0] =~ m/ ^\s* (?:use|require) \s* v? ([\d_\.]+) \s* ; /ixms ) { my $perl_version = $1; $perl_version =~ s{_}{}g; return $perl_version; } else { return; } } sub perl_version_from { my $self = shift; my $perl_version=_extract_perl_version(Module::Install::_read($_[0])); if ($perl_version) { $self->perl_version($perl_version); } else { warn "Cannot determine perl version info from $_[0]\n"; return; } } sub author_from { my $self = shift; my $content = Module::Install::_read($_[0]); if ($content =~ m/ =head \d \s+ (?:authors?)\b \s* ([^\n]*) | =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s* .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s* ([^\n]*) /ixms) { my $author = $1 || $2; # XXX: ugly but should work anyway... if (eval "require Pod::Escapes; 1") { # Pod::Escapes has a mapping table. # It's in core of perl >= 5.9.3, and should be installed # as one of the Pod::Simple's prereqs, which is a prereq # of Pod::Text 3.x (see also below). $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $Pod::Escapes::Name2character_number{$1} ? chr($Pod::Escapes::Name2character_number{$1}) : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) { # Pod::Text < 3.0 has yet another mapping table, # though the table name of 2.x and 1.x are different. # (1.x is in core of Perl < 5.6, 2.x is in core of # Perl < 5.9.3) my $mapping = ($Pod::Text::VERSION < 2) ? \%Pod::Text::HTML_Escapes : \%Pod::Text::ESCAPES; $author =~ s{ E<( (\d+) | ([A-Za-z]+) )> } { defined $2 ? chr($2) : defined $mapping->{$1} ? $mapping->{$1} : do { warn "Unknown escape: E<$1>"; "E<$1>"; }; }gex; } else { $author =~ s{E}{<}g; $author =~ s{E}{>}g; } $self->author($author); } else { warn "Cannot determine author info from $_[0]\n"; } } #Stolen from M::B my %license_urls = ( perl => 'http://dev.perl.org/licenses/', apache => 'http://apache.org/licenses/LICENSE-2.0', apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1', artistic => 'http://opensource.org/licenses/artistic-license.php', artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php', lgpl => 'http://opensource.org/licenses/lgpl-license.php', lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php', lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html', bsd => 'http://opensource.org/licenses/bsd-license.php', gpl => 'http://opensource.org/licenses/gpl-license.php', gpl2 => 'http://opensource.org/licenses/gpl-2.0.php', gpl3 => 'http://opensource.org/licenses/gpl-3.0.html', mit => 'http://opensource.org/licenses/mit-license.php', mozilla => 'http://opensource.org/licenses/mozilla1.1.php', open_source => undef, unrestricted => undef, restrictive => undef, unknown => undef, ); sub license { my $self = shift; return $self->{values}->{license} unless @_; my $license = shift or die( 'Did not provide a value to license()' ); $license = __extract_license($license) || lc $license; $self->{values}->{license} = $license; # Automatically fill in license URLs if ( $license_urls{$license} ) { $self->resources( license => $license_urls{$license} ); } return 1; } sub _extract_license { my $pod = shift; my $matched; return __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ L(?i:ICEN[CS]E|ICENSING)\b.*?) (=head \d.*|=cut.*|)\z /xms ) || __extract_license( ($matched) = $pod =~ m/ (=head \d \s+ (?:C(?i:OPYRIGHTS?)|L(?i:EGAL))\b.*?) (=head \d.*|=cut.*|)\z /xms ); } sub __extract_license { my $license_text = shift or return; my @phrases = ( '(?:under )?the same (?:terms|license) as (?:perl|the perl (?:\d )?programming language)' => 'perl', 1, '(?:under )?the terms of (?:perl|the perl programming language) itself' => 'perl', 1, 'Artistic and GPL' => 'perl', 1, 'GNU general public license' => 'gpl', 1, 'GNU public license' => 'gpl', 1, 'GNU lesser general public license' => 'lgpl', 1, 'GNU lesser public license' => 'lgpl', 1, 'GNU library general public license' => 'lgpl', 1, 'GNU library public license' => 'lgpl', 1, 'GNU Free Documentation license' => 'unrestricted', 1, 'GNU Affero General Public License' => 'open_source', 1, '(?:Free)?BSD license' => 'bsd', 1, 'Artistic license 2\.0' => 'artistic_2', 1, 'Artistic license' => 'artistic', 1, 'Apache (?:Software )?license' => 'apache', 1, 'GPL' => 'gpl', 1, 'LGPL' => 'lgpl', 1, 'BSD' => 'bsd', 1, 'Artistic' => 'artistic', 1, 'MIT' => 'mit', 1, 'Mozilla Public License' => 'mozilla', 1, 'Q Public License' => 'open_source', 1, 'OpenSSL License' => 'unrestricted', 1, 'SSLeay License' => 'unrestricted', 1, 'zlib License' => 'open_source', 1, 'proprietary' => 'proprietary', 0, ); while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) { $pattern =~ s#\s+#\\s+#gs; if ( $license_text =~ /\b$pattern\b/i ) { return $license; } } return ''; } sub license_from { my $self = shift; if (my $license=_extract_license(Module::Install::_read($_[0]))) { $self->license($license); } else { warn "Cannot determine license info from $_[0]\n"; return 'unknown'; } } sub _extract_bugtracker { my @links = $_[0] =~ m#L<( https?\Q://rt.cpan.org/\E[^>]+| https?\Q://github.com/\E[\w_]+/[\w_]+/issues| https?\Q://code.google.com/p/\E[\w_\-]+/issues/list )>#gx; my %links; @links{@links}=(); @links=keys %links; return @links; } sub bugtracker_from { my $self = shift; my $content = Module::Install::_read($_[0]); my @links = _extract_bugtracker($content); unless ( @links ) { warn "Cannot determine bugtracker info from $_[0]\n"; return 0; } if ( @links > 1 ) { warn "Found more than one bugtracker link in $_[0]\n"; return 0; } # Set the bugtracker bugtracker( $links[0] ); return 1; } sub requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+(v?[\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->requires( $module => $version ); } } sub test_requires_from { my $self = shift; my $content = Module::Install::_readperl($_[0]); my @requires = $content =~ m/^use\s+([^\W\d]\w*(?:::\w+)*)\s+([\d\.]+)/mg; while ( @requires ) { my $module = shift @requires; my $version = shift @requires; $self->test_requires( $module => $version ); } } # Convert triple-part versions (eg, 5.6.1 or 5.8.9) to # numbers (eg, 5.006001 or 5.008009). # Also, convert double-part versions (eg, 5.8) sub _perl_version { my $v = $_[-1]; $v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e; $v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e; $v =~ s/(\.\d\d\d)000$/$1/; $v =~ s/_.+$//; if ( ref($v) ) { # Numify $v = $v + 0; } return $v; } sub add_metadata { my $self = shift; my %hash = @_; for my $key (keys %hash) { warn "add_metadata: $key is not prefixed with 'x_'.\n" . "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/; $self->{values}->{$key} = $hash{$key}; } } ###################################################################### # MYMETA Support sub WriteMyMeta { die "WriteMyMeta has been deprecated"; } sub write_mymeta_yaml { my $self = shift; # We need YAML::Tiny to write the MYMETA.yml file unless ( eval { require YAML::Tiny; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.yml\n"; YAML::Tiny::DumpFile('MYMETA.yml', $meta); } sub write_mymeta_json { my $self = shift; # We need JSON to write the MYMETA.json file unless ( eval { require JSON; 1; } ) { return 1; } # Generate the data my $meta = $self->_write_mymeta_data or return 1; # Save as the MYMETA.yml file print "Writing MYMETA.json\n"; Module::Install::_write( 'MYMETA.json', JSON->new->pretty(1)->canonical->encode($meta), ); } sub _write_mymeta_data { my $self = shift; # If there's no existing META.yml there is nothing we can do return undef unless -f 'META.yml'; # We need Parse::CPAN::Meta to load the file unless ( eval { require Parse::CPAN::Meta; 1; } ) { return undef; } # Merge the perl version into the dependencies my $val = $self->Meta->{values}; my $perl = delete $val->{perl_version}; if ( $perl ) { $val->{requires} ||= []; my $requires = $val->{requires}; # Canonize to three-dot version after Perl 5.6 if ( $perl >= 5.006 ) { $perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e } unshift @$requires, [ perl => $perl ]; } # Load the advisory META.yml file my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; if ( exists $val->{requires} ) { $meta->{requires} = { map { @$_ } @{ $val->{requires} } }; } if ( exists $val->{build_requires} ) { $meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } }; } return $meta; } 1; WWW-Search-Ebay-3.042/MANIFEST0000644000000000000000000000133712575325364014136 0ustar rootrootChanges inc/Module/Install.pm inc/Module/Install/AuthorTests.pm inc/Module/Install/Base.pm inc/Module/Install/Can.pm inc/Module/Install/Fetch.pm inc/Module/Install/Makefile.pm inc/Module/Install/Metadata.pm inc/Module/Install/PerlTar.pm inc/Module/Install/Win32.pm inc/Module/Install/WriteAll.pm lib/WWW/Search/Ebay.pm lib/WWW/Search/Ebay/Auctions.pm lib/WWW/Search/Ebay/BuyItNow.pm lib/WWW/Search/Ebay/ByEndDate.pm lib/WWW/Search/Ebay/BySellerID.pm lib/WWW/Search/Ebay/Category.pm lib/WWW/Search/Ebay/Motors.pm lib/WWW/Search/Ebay/Stores.pm LICENSE Makefile.PL MANIFEST This list of files META.yml README README.md t/category.t t/coverage.t t/ebay.t t/enddate.t t/itemnumber.t t/pod-coverage.t t/pod.t xt/buyitnow.t xt/bysellerid.t WWW-Search-Ebay-3.042/README0000644000000000000000000000124512114301127013637 0ustar rootroot This is a backend for use with the WWW::Search module. NOTE NOTE NOTE NOTE NOTE STARTING WITH THE 3.001 DISTRIBUTION OF 2008-11-10, WWW::Search::Ebay IS NOT ABLE TO FOLLOW THE "NEXT" LINK ON THE SEARCH RESULTS PAGE. THEREFORE IT WILL NOT RETURN MORE THAN 200 RESULTS. ==== ==== ==== ==== ==== Please read the README for WWW::Search for general information. (One place to find it is http://www.perl.com/CPAN-local/modules/by-module/WWW/WWW-Search-2.45.readme ) Read the Changes file in this distribution to see what is new with this backend since the previous release. Please visit http://www.sandcrawler.com/SWB/cpan-modules.html for more information. WWW-Search-Ebay-3.042/README.md0000644000000000000000000000011312575303434014245 0ustar rootroot# WWW-Search-Ebay Perl module / backend for WWW::Search that searches eBay WWW-Search-Ebay-3.042/Makefile.PL0000644000000000000000000000323112575325555014754 0ustar rootroot # $rcs = ' $Id: Makefile.PL,v 1.104 2015-06-06 19:55:18 Martin Exp $ '; use inc::Module::Install; version(3.042); all_from('lib/WWW/Search/Ebay.pm'); requires(perl => 5.005); test_requires('Bit::Vector'); requires('Date::Manip'); # requires('DateTime::TimeZone'); test_requires('Date::Manip'); requires('HTML::TreeBuilder'); test_requires('IO::Capture::Stderr'); requires('LWP::Simple'); # Test::More is needed for `make test`: test_requires('Test::More'); recommends('Test::Pod'); recommends('Test::Pod::Coverage'); # We need the version that has methods named with leading underscore: requires('WWW::Search' => 2.557); # We need the version that has the bidder and seller methods: requires('WWW::SearchResult' => 2.067); # We need the bug-fixed version of WWW::Search::Test: test_requires('WWW::Search::Test' => 2.290); author_tests('xt'); my $ret = <<'PART0'; coverage : $(RM_RF) cover_db/* $(MAKE) HARNESS_PERL_SWITCHES=-MDevel::Cover test cover PART0 postamble $ret; use Env; if ($ENV{MTHURN_PERL_DEV}) { warn "DDD This is author's development environment\n"; use_ptar(); } # if WriteAll; if (0 && $ENV{MTHURN_PERL_DEV}) { my $sFnameMakefile = q{Makefile}; eval "use File::Slurp"; my $s = read_file($sFnameMakefile); if ($s !~ s/(DIRFILESEP\s*=\s*).+$/$1\//m) { warn " EEE did not find DIRFILESEP in Makefile\n"; } # if if ($s !~ s/(pm_to_blib\(){{\@ARGV}}/$1 . '{@ARGV}'/e) { warn " EEE did not find pm_to_blib@ARGV in Makefile\n"; } # if if ($s !~ s/(from_to\s+=>\s+){{\@ARGV}}/$1 . '{@ARGV}'/e) { warn " EEE did not find from_to@ARGV in Makefile\n"; } # if write_file($sFnameMakefile, $s); } # if __END__ WWW-Search-Ebay-3.042/lib/0000755000000000000000000000000012575327515013547 5ustar rootrootWWW-Search-Ebay-3.042/lib/WWW/0000755000000000000000000000000012575327515014233 5ustar rootrootWWW-Search-Ebay-3.042/lib/WWW/Search/0000755000000000000000000000000012575327516015441 5ustar rootrootWWW-Search-Ebay-3.042/lib/WWW/Search/Ebay.pm0000644000000000000000000011100312575325454016652 0ustar rootroot # $Id: Ebay.pm,v 2.271 2015-09-13 14:28:54 Martin Exp $ package WWW::Search::Ebay; use strict; use warnings; =head1 NAME WWW::Search::Ebay - backend for searching www.ebay.com =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay'); my $sQuery = WWW::Search::escape_query("C-10 carded Yakface"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION This class is a Ebay specialization of L. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES The search is done against CURRENT running AUCTIONS only. (NOT completed auctions, NOT eBay Stores items, NOT Buy-It-Now only items.) (If you want to search completed auctions, use the L module.) (If you want to search eBay Stores, use the L module.) The query is applied to TITLES only. This module can return only the first 200 results matching your query. In the resulting L objects, the description() field consists of a human-readable combination (joined with semicolon-space) of the Item Number; number of bids; and high bid amount (or starting bid amount). In the resulting L objects, the end_date() field contains a human-readable DTG of when the auction is scheduled to end (in the form "YYYY-MM-DD HH:MM TZ"). If environment variable TZ is set, the time will be converted to that timezone; otherwise the time will be left in ebay.com's default timezone (US/Pacific). In the resulting L objects, the bid_count() field contains the number of bids as an integer. In the resulting L objects, the bid_amount() field is a string containing the high bid or starting bid as a human-readable monetary value in seller-native units, e.g. "$14.95" or "GBP 6.00". In the resulting L objects, the sold() field will be non-zero if the item has already sold. (Only if you're using WWW::Search::Ebay::Completed) After a successful search, your search object will contain an element named 'categories' which will be a reference to an array of hashes containing names and IDs of categories and nested subcategories, and the count of items matching your query in each category and subcategory. (Special thanks to Nick Lokkju for this code!) For example: $oSearch->{categories} = [ { 'ID' => '1', 'Count' => 19, 'Name' => 'Collectibles', 'Subcategory' => [ { 'ID' => '13877', 'Count' => 11, 'Name' => 'Historical Memorabilia' }, { 'ID' => '11450', 'Count' => 1, 'Name' => 'Clothing, Shoes & Accessories' }, ] }, { 'ID' => '281', 'Count' => 1, 'Name' => 'Jewelry & Watches', } ]; If your query string happens to be an eBay item number, (i.e. if ebay.com redirects the query to an auction page), you will get back one WWW::Search::Result without bid or price information. =head1 OPTIONS =over =item Limit search by price range Contributed by Brian Wilson: $oSearch->native_query($sQuery, { _mPrRngCbx=>'1', _udlo=>$minPrice, _udhi=>$maxPrice, } ); =back =head1 PUBLIC METHODS OF NOTE =over =cut use base 'WWW::Search'; use constant DEBUG_DATES => 0; use constant DEBUG_COLUMNS => 0; use Carp (); use CGI; use Data::Dumper; # for debugging only use Date::Manip; # Date_Init("setdate=now,America/Los_Angeles"); use HTML::TreeBuilder; use LWP::Simple; use WWW::Search qw( generic_option strip_tags ); # We need the version that has the sold() method: use WWW::SearchResult 2.072; use WWW::Search::Result; our $VERSION = 2.272; our $MAINTAINER = 'Martin Thurn '; my $cgi = new CGI; sub _native_setup_search { my ($self, $native_query, $rhOptsArg) = @_; # Set some private variables: $self->{_debug} ||= $rhOptsArg->{'search_debug'}; $self->{_debug} = 2 if ($rhOptsArg->{'search_parse_debug'}); $self->{_debug} ||= 0; my $DEFAULT_HITS_PER_PAGE = 200; $self->{'_hits_per_page'} = $DEFAULT_HITS_PER_PAGE; $self->user_agent('non-robot'); $self->agent_name('Mozilla/5.0 (compatible; Mozilla/4.0; MSIE 6.0; Windows NT 5.1; Q312461)'); $self->{'_next_to_retrieve'} = 0; $self->{'_num_hits'} = 0; # As of 2013-03-01 (probably much before that, but first time I # looked at it in quite a while):

To use our basic experience # which does not require JavaScript, click # here.

$self->{search_host} ||= 'http://www.ebay.com'; # as of 2013-03-01 $self->{search_host} ||= 'http://search.ebay.com'; $self->{search_path} ||= '/sch/i.html'; # as of 2013-03-01 $self->{search_path} ||= '/ws/search/SaleSearch'; if (!defined($self->{_options})) { # http://shop.ebay.com/items/_W0QQLHQ5fBINZ1?_nkw=trinidad+flag&_sacat=0&_fromfsb=&_trksid=m270.l1313&_odkw=burkina+faso+flag&_osacat=0 $self->{_options} = { satitle => $native_query, # Search AUCTIONS ONLY: sasaleclass => 1, # Display item number explicitly: socolumnlayout => 2, # Do not convert everything to US$: socurrencydisplay => 1, sorecordsperpage => $self->{_hits_per_page}, _ipg => $self->{_hits_per_page}, # Display absolute times, NOT relative times: sotimedisplay => 0, # Use the default columns, NOT anything the # user may have customized (which would come # through via cookies): socustoverride => 1, # Output basic HTML, not JavaScript: _armrs => 1, }; $self->{_options} = { _nkw => $native_query, _armrs => 1, # Turn off JavaScript: _jsoff => 1, # Search AUCTIONS ONLY: LH_Auction => 1, _ipg => $self->{_hits_per_page}, # Which page are we on: # _from => 2, # }; } # if if (defined($rhOptsArg)) { # Copy in new options. foreach my $key (keys %$rhOptsArg) { # print STDERR " DDD inspecting option $key..."; if (WWW::Search::generic_option($key)) { # print STDERR "promote & delete\n"; $self->{$key} = $rhOptsArg->{$key} if defined($rhOptsArg->{$key}); delete $rhOptsArg->{$key}; } else { # print STDERR "copy\n"; $self->{_options}->{$key} = $rhOptsArg->{$key} if defined($rhOptsArg->{$key}); } } # foreach } # if # Clear the list of results per category: $self->{categories} = []; # Finally, figure out the url. $self->{_next_url} = $self->{'search_host'} . $self->{'search_path'} .'?'. $self->hash_to_cgi_string($self->{_options}); } # _native_setup_search =item user_agent_delay Introduce a few-seconds delay to avoid overwhelming the server. =cut sub user_agent_delay { my $self = shift; # return; my $iSecs = int(3 + rand(3)); print STDERR " DDD sleeping $iSecs seconds...\n" if (0 < $self->{_debug}); sleep($iSecs); } # user_agent_delay =item need_to_delay Controls whether we do the delay or not. =cut sub need_to_delay { 1; } # need_to_delay =item preprocess_results_page Grabs the eBay Official Time so that when we parse the DTG from the HTML, we can convert / return exactly what eBay means for each one. =cut sub preprocess_results_page { my $self = shift; my $sPage = shift; if (25 < $self->{_debug}) { # print STDERR Dumper($self->{response}); # For debugging: print STDERR $sPage; exit 88; } # if my $sTitle = $self->{response}->header('title') || ''; my $qrTitle = $self->_title_pattern; if ($sTitle =~ m!$qrTitle!) { # print STDERR " DDD got a Title: ==$sTitle==\n"; # This search returned a single auction item page. We do not need # to fetch eBay official time. } # if else { # Use the UserAgent object in $self to fetch the official ebay.com time: $self->{_ebay_official_time} = 'now'; # my $sPageDate = get('http://cgi1.ebay.com/aw-cgi/eBayISAPI.dll?TimeShow') || ''; my $sPageDate = $self->http_request(GET => 'http://viv.ebay.com/ws/eBayISAPI.dll?EbayTime')->content || ''; if ($sPageDate eq '') { die " EEE could not fetch official eBay time"; } else { my $tree = HTML::TreeBuilder->new; $tree->utf8_mode('true'); $tree->parse($sPageDate); $tree->eof; my $s = $tree->as_text; # print STDERR " DDD official time =====$s=====\n"; if ($s =~ m!The official eBay Time is now:(.+?(P[SD]T))\s*Pacific\s!i) { my ($sDateRaw, $sTZ) = ($1, $2); DEBUG_DATES && print STDERR " DDD official time raw ==$sDateRaw==\n"; # Apparently, ParseDate() automatically converts to local timezone: my $date = ParseDate($sDateRaw); DEBUG_DATES && print STDERR " DDD official time cooked ==$date==\n"; $self->{_ebay_official_time} = $date; } # if } # else } # else return $sPage; # Ebay used to send malformed HTML: # my $iSubs = 0 + ($sPage =~ s!!!gi); # print STDERR " DDD deleted $iSubs extraneous tags\n" if 1 < $self->{_debug}; } # preprocess_results_page sub _cleanup_url { my $self = shift; my $sURL = shift() || ''; # Make sure we don't return two different URLs for the same item: $sURL =~ s!&rd=\d+!!; $sURL =~ s!&category=\d+!!; $sURL =~ s!&ssPageName=[A-Z0-9]+!!; return $sURL; } # _cleanup_url sub _format_date { my $self = shift; return UnixDate(shift, '%Y-%m-%d %H:%M %Z'); } # _format_date sub _bidcount_as_text { my $self = shift; my $hit = shift; my $iBids = $hit->bid_count || 'no'; my $s = "$iBids bid"; $s .= 's' if ($iBids ne '1'); $s .= '; '; } # _bidcount_as_text sub _bidamount_as_text { my $self = shift; my $hit = shift; my $iPrice = $hit->bid_amount || 'unknown'; my $sDesc = ''; $sDesc .= $hit->bid_count ? 'current' : 'starting'; $sDesc .= " bid $iPrice"; } # _bidamount_as_text sub _create_description { my $self = shift; my $hit = shift; my $iItem = $hit->item_number || 'unknown'; my $sWhen = shift() || 'current'; # print STDERR " DDD _c_d($iItem, $iBids, $iPrice, $sWhen)\n"; my $sDesc = "Item \043$iItem; ". $self->_bidcount_as_text($hit); $sDesc .= $self->_bidamount_as_text($hit); return $sDesc; } # _create_description sub _parse_category { my $self = shift; my $oTD = shift; return -1 if ! ref $oTD; my $oA = $oTD->look_down(_tag => 'a'); return -1 if ! ref $oA; if (DEBUG_COLUMNS || (1 < $self->{_debug})) { my $s = $oA->as_HTML; print STDERR " DDD TDcategory's A ===$s===\n"; } # if my $sURL = $oA->attr('href') || q{}; if ($sURL =~ m/sibeleafcat=(\d+)/) { return $1; } # if return -1; } # _parse_category sub _parse_price { my $self = shift; my $oTDprice = shift; my $hit = shift; return 0 unless (ref $oTDprice); my $s = $oTDprice->as_HTML; if (DEBUG_COLUMNS || (1 < $self->{_debug})) { print STDERR " DDD try TDprice ===$s===\n"; } # if if ($oTDprice->attr('class') =~ m'\bebcBid\b') { # If we see this, we must have been searching for Stores items # but we ran off the bottom of the Stores item list and ran # into the list of "other" items. return 1; # We could probably return 0 to abandon the rest of the page, but # maybe just maybe we hit this because of a parsing glitch which # might correct itself on the next TD. } # if if ($oTDprice->attr('class') !~ m'\b(ebcPr|prices|prc)\b') { # If we see this, we probably were searching for Store items # but we ran off the bottom of the Store item list and ran # into the list of Auction items. return 0; # There is a separate backend for searching Auction items! } # if if ( $oTDprice->look_down(_tag => 'span', class => 'ebSold') || $oTDprice->look_down(_tag => 'span', class => 'bold bidsold') ) { # This item sold, even if it had no bids (i.e. Buy-It-Now) $hit->sold(1); } # if if (my $oChild = $oTDprice->look_down(_tag => 'div', itemprop => 'price')) { # As of 2013-03, we need to separate out the price and the bid: $oTDprice = $oChild; } # if my $iPrice = $oTDprice->as_text; print STDERR " DDD raw iPrice ===$iPrice===\n" if (DEBUG_COLUMNS || (1 < $self->{_debug})); $iPrice =~ s!£!GBP!; $iPrice =~ s!\s*Trending.+!!; $iPrice =~ s!\s*Was.+!!; # Convert nbsp to regular space: $iPrice =~ s!\240!\040!g; # I don't know why there are sometimes weird characters in there: $iPrice =~ s!Â!!g; $iPrice =~ s!Â!!g; my $currency = $self->_currency_pattern; my $W = $self->whitespace_pattern; $iPrice =~ s!($currency)$W*($currency)!$1 (Buy-It-Now for $2)!; if ($iPrice =~ s/FREE\s+SHIPPING//i) { $hit->shipping('free'); } # if $hit->bid_amount($iPrice); return 1; } # _parse_price sub _parse_bids { my $self = shift; my $oTDbids = shift; my $hit = shift; my $iBids = 0; if (ref $oTDbids) { if (my $oChild = $oTDbids->look_down(_tag => 'div', class => 'bids')) { # As of 2013-03, we need to separate out the price and the bid: $oTDbids = $oChild; } # if my $s = $oTDbids->as_HTML; if (DEBUG_COLUMNS || (1 < $self->{_debug})) { print STDERR " DDD TDbids ===$s===\n"; } # if if ($oTDbids->attr('class') !~ m'\b(ebcBid|bids)\b') { # If we see this, we probably were searching for Store items # but we ran off the bottom of the Store item list and ran # into the list of Auction items. return 0; # There is a separate backend for searching Auction items! } # if $iBids = 1 if ($oTDbids->as_text =~ m/SOLD/i); $iBids = $1 if ($oTDbids->as_text =~ m/(\d+)/); my $W = $self->whitespace_pattern; if ( # Bid listed as hyphen means no bids: ($iBids =~ m!\A$W*-$W*\Z!) || # Bid listed as whitespace means no bids: ($iBids =~ m!\A$W*\Z!) ) { $iBids = 0; } # if } # if if ($iBids =~ m/NO/i) { $iBids = 0; } # if $iBids ||= 0; # print STDERR " DDD setting bid_count to =$iBids=\n"; $hit->bid_count($iBids); return 1; } # _parse_bids sub _parse_shipping { my $self = shift; my $oTD = shift; my $hit = shift; if ($oTD->attr('class') =~ m'\bebcCty\b') { # If we see this, we probably were searching for UK auctions # but we ran off the bottom of the UK item list and ran # into the list of international items. return 0; } # if if (my $oChild = $oTD->look_down(_tag => 'span', class => 'ship')) { # As of 2013-03, we need to separate out the price and the # shipping for some flavors of eBay: $oTD = $oChild; } # if my $iPrice = $oTD->as_text; # I don't know why there are sometimes weird characters in there: $iPrice =~ s!Â!!g; $iPrice =~ s!Â!!g; print STDERR " DDD raw shipping ===$iPrice===\n" if (DEBUG_COLUMNS || (1 < $self->{_debug})); if ($iPrice =~ m/FREE/i) { $iPrice = 0.00; } # if return 0 if ($iPrice !~ m/\d/); $iPrice =~ s!£!GBP!; $hit->shipping($iPrice); return 1; } # _parse_shipping sub _parse_skip { my $self = shift; my $oTD = shift; my $hit = shift; return 1; } # _parse_skip sub _parse_enddate { my $self = shift; my $oTDdate = shift; my $hit = shift; my $sDate = 'unknown'; my ($s, $sDateTemp); if (ref $oTDdate) { $sDateTemp = $oTDdate->as_text; $s = $oTDdate->as_HTML; } # if else { $sDateTemp = $s = $oTDdate; } print STDERR " DDD TDdate ===$s===\n" if (DEBUG_COLUMNS || (1 < $self->{_debug})); # New version as of 2013-03: if ($s =~ m/\bTIMEMS="(\d+)"/i) { $sDate = $1; $sDate = $self->_format_date(ParseDate(q{epoch }. int($sDate/1000))); print STDERR " DDD sDate =$sDate=\n" if (DEBUG_COLUMNS || (1 < $self->{_debug})); $hit->end_date($sDate); # For backward-compatibility: $hit->change_date($sDate); return 1; } if (ref($oTDdate)) { my $sClass = $oTDdate->attr('class') || q{}; if ($sClass !~ m/\b(col3|ebcTim|ti?me)\b/) { # If we see this, we probably were searching for Buy-It-Now items # but we ran off the bottom of the item list and ran into the list # of Store items. return 0; # There is a separate backend for searching Store items! } # if } # if print STDERR " DDD raw sDateTemp ===$sDateTemp===\n" if (DEBUG_DATES || (1 < $self->{_debug})); if ($sDateTemp =~ m/---/) { # If we see this, we probably were searching for Buy-It-Now items # but we ran off the bottom of the item list and ran into the list # of Store items. return 0; # There is a separate backend for searching Store items! } # if # I don't know why there are sometimes weird characters in there: $sDateTemp =~ s!Â!!g; $sDateTemp =~ s!Â!!g; $sDateTemp =~ s!_process_date_abbrevs($sDateTemp); print STDERR " DDD cooked sDateTemp ===$sDateTemp===\n" if (DEBUG_DATES || (1 < $self->{_debug})); print STDERR " DDD official time =====$self->{_ebay_official_time}=====\n" if (DEBUG_DATES || (1 < $self->{_debug})); my $date = DateCalc($self->{_ebay_official_time}, " + $sDateTemp"); print STDERR " DDD date ===$date===\n" if (DEBUG_DATES || (1 < $self->{_debug})); $sDate = $self->_format_date($date); print STDERR " DDD sDate ===$sDate===\n" if (DEBUG_DATES || (1 < $self->{_debug})); $hit->end_date($sDate); # For backward-compatibility: $hit->change_date($sDate); return 1; } # _parse_enddate =item result_as_HTML Given a WWW::SearchResult object representing an auction, formats it human-readably with HTML. An optional second argument is the date format, a string as specified for Date::Manip::UnixDate. Default is '%Y-%m-%d %H:%M:%S' my $sHTML = $oSearch->result_as_HTML($oSearchResult, '%H:%M %b %E'); =cut sub result_as_HTML { my $self = shift; my $oSR = shift or return ''; my $sDateFormat = shift || q'%Y-%m-%d %H:%M:%S'; my $dateEnd = ParseDate($oSR->end_date) || q{}; my $iItemNum = $oSR->item_number; my $sSold = $oSR->sold ? $cgi->font({color=>'green'}, 'sold') .q{; } : $cgi->font({color=>'red'}, 'not sold') .q{; }; my $sBids = $self->_bidcount_as_text($oSR); my $sPrice = $self->_bidamount_as_text($oSR); my $sEndedColor = 'green'; my $sEndedWord = 'ends'; my $dateNow = ParseDate('now'); print STDERR " DDD compare end_date ==$dateEnd==\n" if (DEBUG_DATES || (1 < $self->{_debug})); print STDERR " DDD compare date_now ==$dateNow==\n" if (DEBUG_DATES || (1 < $self->{_debug})); if (Date_Cmp($dateEnd, $dateNow) < 0) { $sEndedColor = 'red'; $sEndedWord = 'ended'; } # if my $sEnded = $cgi->font({ color => $sEndedColor }, UnixDate($dateEnd, qq"$sEndedWord $sDateFormat")); my $s = $cgi->b( $cgi->a({href => $oSR->url}, $oSR->title), $cgi->br, qq{$sEnded; $sSold$sBids$sPrice}, ); $s .= $cgi->br; $s .= $cgi->font({size => -1}, $cgi->a({href => qq{http://cgi.ebay.com/ws/eBayISAPI.dll?MakeTrack&item=$iItemNum}}, 'watch this item in MyEbay'), ); # Format the entire thing as Helvetica: $s = $cgi->font({face => 'Arial, Helvetica'}, $s); return $s; } # result_as_HTML =back =head1 METHODS TO BE OVERRIDDEN IN SUBCLASSING You only need to read about these if you are subclassing this module (i.e. making a backend for another flavor of eBay search). =over =cut =item _get_result_count_elements Given an HTML::TreeBuilder object, return a list of HTML::Element objects therein which could possibly contain the approximate result count verbiage. =cut sub _get_result_count_elements { my $self = shift; my $tree = shift; my @ao; push @ao, $tree->look_down( # as of 2015-06 '_tag' => 'span', class => 'listingscnt' ); push @ao, $tree->look_down( '_tag' => 'div', class => 'fpcc' ); push @ao, $tree->look_down( '_tag' => 'div', class => 'fpc' ); push @ao, $tree->look_down( # For basic search, as of 2013-03: '_tag' => 'div', class => 'clt' ); push @ao, $tree->look_down( '_tag' => 'div', class => 'count' ); push @ao, $tree->look_down( '_tag' => 'div', class => 'pageCaptionDiv' ); push @ao, $tree->look_down( # for BySellerID as of 2010-07 '_tag' => 'div', id => 'rsc' ); return @ao; } # _get_result_count_elements =item _get_itemtitle_tds Given an HTML::TreeBuilder object, return a list of HTML::Element objects therein representing elements which could possibly contain the HTML for result title and hotlink. =cut sub _get_itemtitle_tds { my $self = shift; my $tree = shift; my @ao = $tree->look_down(_tag => 'td', class => 'details', ); push @ao, $tree->look_down(_tag => 'td', class => 'ebcTtl', ); push @ao, $tree->look_down(_tag => 'td', class => 'dtl', # This is for eBay auctions as of 2010-07 ); # This is for BuyItNow (thanks to Brian Wilson): push @ao, $tree->look_down(_tag => 'td', class => 'details ttl', ); my $oDiv = $tree->look_down(_tag => 'div', id => 'ResultSetItems', ); if (ref $oDiv) { push @ao, $oDiv->look_down(_tag => 'td', class => 'dtl dtlsp', ); push @ao, $oDiv->look_down(_tag => 'h3', class => 'lvtitle', ); } # if return @ao; } # _get_itemtitle_tds sub _parse_tree { my $self = shift; my $tree = shift; print STDERR " FFF Ebay::_parse_tree\n" if (1 < $self->{_debug}); my $sTitle = $self->{response}->header('title') || ''; my $qrTitle = $self->_title_pattern; # print STDERR " DDD trying to match ==$sTitle== against ==$qrTitle==\n"; if ($sTitle =~ m!$qrTitle!) { my ($sTitle, $iItem, $sDateRaw) = ($1, $2, $3); my $sDateCooked = $self->_format_date($sDateRaw); my $hit = new WWW::Search::Result; $hit->item_number($iItem); $hit->end_date($sDateCooked); # For backward-compatibility: $hit->change_date($sDateCooked); $hit->title($sTitle); $hit->add_url($self->{response}->request->uri); $hit->description($self->_create_description($hit)); # print Dumper($hit); push(@{$self->{cache}}, $hit); $self->{'_num_hits'}++; $self->approximate_result_count(1); return 1; } # if # First, see if: there were zero results and eBay automatically did # a spell-check and searched for other words (or searched for a # subset of query terms): my $oDIV = $tree->look_down( _tag => 'div', class => 'messages', ); if (ref $oDIV) { my $sText = $oDIV->as_text; if ( ($sText =~ m/0 results found for /) && ( ($sText =~ m/ so we searched for /) || ($sText =~ m/ so we removed keywords /) ) ) { $self->approximate_result_count(0); return 0; } # if } # if # See if our query was completely replaced by a similar-spelling query: my $oLI = $tree->look_down(_tag => 'li', class => 'ebInf', ); if (ref $oLI) { if ($oLI->as_text =~ m! keyword has been replaced !) { $self->approximate_result_count(0); return 0; } # if } # if # See if our category-only query was replaced by a global query: my $oP = $tree->look_down(_tag => 'p', class => 'sm-md', ); if (ref $oP) { my $s = $oP->as_text; if (($s =~ m/0 results found in the/) && ($s =~ m/so we searched in all categories/)) { return 0; } # if } # if my $iHits = 0; # The hit count is in one of these tags: my @aoResultCountTagset = $self->_get_result_count_elements($tree); if (scalar(@aoResultCountTagset) < 1) { warn " EEE no result_count_elements matched the HTML\n"; } # if FONT: foreach my $oFONT (@aoResultCountTagset) { my $qr = $self->_result_count_pattern; print STDERR (" DDD result_count try ==", $oFONT->as_text, "== against qr=$qr=\n") if (1 < $self->{_debug}); if ($oFONT->as_text =~ m!$qr!) { my $sCount = $1; print STDERR " DDD matched ($sCount)\n" if (1 < $self->{_debug}); # Make sure it's an integer: $sCount =~ s!,!!g; $self->approximate_result_count(0 + $sCount); last FONT; } # if } # foreach if ($self->approximate_result_count() < 1) { return $iHits; } # if # Recursively parse the stats telling how many items were found in # each category: my $oUL = $tree->look_down(_tag => 'ul', class => 'categories'); $self->{categories} ||= []; $self->_parse_category_list($oUL, $self->{categories}) if ref($oUL); # First, delete all the results that came from spelling variations: my $oDiv = $tree->look_down(_tag => 'div', id => 'expSplChk', ); if (ref $oDiv) { # print STDERR " DDD found a spell-check ===", $oDiv->as_text, "===\n"; $oDiv->detach; $oDiv->delete; } # if # The list of matching items is in a table. The first column of the # table is nothing but icons; the second column is the good stuff. my @aoTD = $self->_get_itemtitle_tds($tree); unless (@aoTD) { print STDERR " EEE did not find table of results\n" if $self->{_debug}; # use File::Slurp; # write_file('no-results.html', $self->{response}->content); } # unless my $qrItemNum = qr{(\d{11,13})}; TD: foreach my $oTDtitle (@aoTD) { # Sanity check: next TD unless ref $oTDtitle; my $sTDtitle = $oTDtitle->as_HTML; print STDERR " DDD try TDtitle ===$sTDtitle===\n" if (1 < $self->{_debug}); # First A tag contains the url & title: my $oA = $oTDtitle->look_down('_tag', 'a'); next TD unless ref $oA; # This is needed for Ebay::UK to make sure we're looking at the right TD: my $sTitle = $oA->as_text || ''; next TD if ($sTitle eq ''); print STDERR " DDD sTitle ===$sTitle===\n" if (1 < $self->{_debug}); my $oURI = URI->new($oA->attr('href')); # next TD unless ($oURI =~ m!ViewItem!); next TD if ($oURI !~ m!$qrItemNum!); my $iItemNum = $1; print STDERR " DDD iItemNum ===$iItemNum===\n" if (1 < $self->{_debug}); my $iCategory = -1; $iCategory = $1 if ($oURI =~ m!QQcategoryZ(\d+)QQ!); if ($oURI->as_string =~ m!QQitemZ(\d+)QQ!) { # Convert new eBay links to old reliable ones: # $oURI->path(''); $oURI->path('/ws/eBayISAPI.dll'); $oURI->query("ViewItem&item=$1"); } # if my $sURL = $oURI->as_string; my $hit = new WWW::Search::Result; $hit->add_url($self->_cleanup_url($sURL)); $hit->title($sTitle); $hit->item_number($iItemNum); # This is just to prevent undef warnings later on: $hit->bid_count(0); # The rest of the info about this item is in sister
  • elements # to the right: my @aoSibs = $oTDtitle->parent->look_down(_tag => q{li}); # The parent itself is an
  • tag: shift @aoSibs; warn " DDD before loop, there are ", scalar(@aoSibs), " sibling TDs\n" if (1 < $self->{_debug}); SIBLING_TD: while (my $oTDsib = shift @aoSibs) { next unless ref($oTDsib); my $sColumn = $oTDsib->attr('class') || q{}; my $s = $oTDsib->as_HTML; if ($sColumn eq q{}) { warn " WWW auction info sibling has no class ==$s==" if (DEBUG_COLUMNS || (1 < $self->{_debug})); } # if print STDERR " DDD looking at TD'$sColumn' ===$s===\n" if (DEBUG_COLUMNS || (1 < $self->{_debug})); if ($sColumn =~ m'price') { next TD unless $self->_parse_price($oTDsib, $hit); } # if if (($sColumn =~ m'bids') || ($sColumn =~ m'format')) { # It is not a fatal error if there are no bids (i.e. buy-it-now) $self->_parse_bids($oTDsib, $hit); } if ($sColumn =~ m'shipping') { next TD if ! $self->_parse_shipping($oTDsib, $hit); } if ($sColumn =~ m'end') { next TD if ! $self->_parse_enddate($oTDsib, $hit); } if ($sColumn =~ 'time') { next TD if ! $self->_parse_enddate($oTDsib, $hit); } if ($sColumn =~ m'country') { # This listing is from a country other than the base site # we're searching against. Throw it out: next TD; } if ($sColumn =~ m'extras') { if ($iCategory < 0) { # We haven't found this item's category. Look for it here: $iCategory = $self->_parse_category($oTDsib); } # if } # if 'extras' # Any other class="" value will cause the
  • to be ignored. } # while my $sDesc = $self->_create_description($hit); $hit->description($sDesc); $hit->category($iCategory); # Clean up / sanity check hit info: my ($enddate, $iBids); if ( defined($enddate = $hit->end_date) && defined($iBids = $hit->bid_count) && (0 < $iBids) # Item got any bids && (Date_Cmp($enddate, 'now') < 0) # Item is ended ) { # Item must have been sold!?! $hit->sold(1); } # if print STDERR " DDD add hit to cache\n" if (1 < $self->{_debug}); push(@{$self->{cache}}, $hit); $self->{'_num_hits'}++; $iHits++; # Delete this HTML element so that future searches go faster? $oTDtitle->detach; $oTDtitle->delete; } # foreach TD undef $self->{_next_url}; if (0) { # AS OF 2008-11 THE NEXT LINK CAN NOT BE FOLLOWED FROM PERL CODE # Look for a NEXT link: my @aoA = $tree->look_down('_tag' => 'a'); TRY_NEXT: foreach my $oA (0, reverse @aoA) { next TRY_NEXT unless ref $oA; print STDERR " DDD try NEXT A ===", $oA->as_HTML, "===\n" if (1 < $self->{_debug}); my $href = $oA->attr('href'); next TRY_NEXT unless $href; # Looking backwards from the bottom of the page, if we get all the # way to the item list, there must be no next button: last TRY_NEXT if ($href =~ m!ViewItem!); if ($oA->as_text eq $self->_next_text) { print STDERR " DDD got NEXT A ===", $oA->as_HTML, "===\n" if 1 < $self->{_debug}; my $sClass = $oA->attr('class') || ''; if ($sClass =~ m/disabled/i) { last TRY_NEXT; } # if $self->{_next_url} = $self->absurl($self->{_prev_url}, $href); last TRY_NEXT; } # if } # foreach } # if 0 # All done with this page. $tree->delete; return $iHits; } # _parse_tree =item _parse_category_list Parses the Category list from the left side of the results page. So far, this method can handle every type of eBay search currently implemented. If you find that it doesn't suit your needs, please contact the author because it's probably just a tiny tweak that's needed. =cut sub _parse_category_list { my $self = shift; my $oTree = shift; my $ra = shift; my $oUL = $oTree->look_down(_tag => 'ul'); my @aoLI = $oUL->look_down(_tag => 'li'); CATLIST_LI: foreach my $oLI (@aoLI) { my %hash; next CATLIST_LI unless ref($oLI); if ($oLI->parent->same_as($oUL)) { my $oA = $oLI->look_down(_tag => 'a'); next CATLIST_LI unless ref($oA); my $oSPAN = $oLI->look_down(_tag => 'span'); next CATLIST_LI unless ref($oSPAN); $hash{'Name'} = $oA->as_text; $hash{'ID'} = $oA->{'href'}; $hash{'ID'} =~ /sacatZ([0-9]+)/; $hash{'ID'} = $1; my $i = $oSPAN->as_text; $i =~ tr/0-9//cd; $hash{'Count'} = $i; push @{$ra}, \%hash; } # if my @aoUL = $oLI->look_down(_tag => 'ul'); CATLIST_UL: foreach my $oUL (@aoUL) { next CATLIST_UL unless ref($oUL); if($oUL->parent()->same_as($oLI)) { $hash{'Subcategory'} = (); $self->_parse_category_list($oLI, \@{$hash{'Subcategory'}}); } # if } # foreach CATLIST_UL } # foreach CATLIST_LI } # _parse_category_list =item _process_date_abbrevs Given a date string, converts common abbreviations to their full words (so that the string can be unambiguously parsed by Date::Manip). For example, in the default English, 'd' becomes 'days'. =cut sub _process_date_abbrevs { my $self = shift; my $s = shift; $s =~ s!d! days!; $s =~ s!h! hours!; $s =~ s!m! minutes!; return $s; } # _process_date_abbrevs =item _next_text The text of the "Next" button, localized for a specific type of eBay backend. =cut sub _next_text { return 'Next'; } # _next_text =item whitespace_pattern Return a qr// pattern to match whitespace your webpage's language. =cut sub whitespace_pattern { # A pattern to match HTML whitespace: return qr{[\ \t\r\n\240]}; } # whitespace_pattern =item _currency_pattern Return a qr// pattern to match mentions of money in your webpage's language. Include the digits in the pattern. =cut sub _currency_pattern { my $self = shift; # A pattern to match all possible currencies found in USA eBay # listings: my $W = $self->whitespace_pattern; return qr/(?:\$|C|EUR|GBP)$W*[0-9.,]+/; } # _currency_pattern =item _title_pattern Return a qr// pattern to match the webpage title in your webpage's language. Add grouping parenthesis so that $1 becomes the auction title, $2 becomes the eBay item number, and $3 becomes the end date. =cut sub _title_pattern { return qr{\A(.+?)\s+-\s+EBAY\s+\(ITEM\s+(\d+)\s+END\s+TIME\s+([^)]+)\)\Z}i; # } # _title_pattern =item _result_count_pattern Return a qr// pattern to match the result count in your webpage's language. Include parentheses so that $1 becomes the number (with commas is OK). =cut sub _result_count_pattern { return qr'([0-9,]+)\s+(active\s+)?(listing|item|matche?|result)s?(\s+found)?'; } # _result_count_pattern 1; __END__ =back =head1 SEE ALSO To make new back-ends, see L. =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. Some fixes along the way contributed by Troy Davis. =head1 LEGALESE THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. =head1 LICENSE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn This software is released under the same license as Perl itself. =cut WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/0000755000000000000000000000000012575327516016321 5ustar rootrootWWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/Category.pm0000644000000000000000000000515512575303716020436 0ustar rootroot # $Id: Category.pm,v 2.5 2015-09-13 14:27:26 Martin Exp $ =head1 NAME WWW::Search::Ebay::Category - backend for returning entire categories on www.ebay.com =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay::Category'); # Category 1381 is Disney Modern Premiums: $oSearch->native_query(1381); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION This class is a Ebay specialization of L. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES Returns the "first" 200 *auction* items in the given category. I'm not sure what exactly "first" means in this case; YMMV. It is up to you to determine the number of the category you want. See the NOTES section of L for a description of the results. =head1 METHODS =cut ##################################################################### package WWW::Search::Ebay::Category; use strict; use warnings; use Carp; use Date::Manip; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 2.5 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; our $MAINTAINER = 'Martin Thurn '; use constant DEBUG_FUNC => 0; sub _native_setup_search { my ($self, $native_query, $rhOptsArg) = @_; $rhOptsArg ||= {}; unless (ref($rhOptsArg) eq 'HASH') { carp " --- second argument to _native_setup_search should be hashref, not arrayref"; return undef; } # unless $self->{_options} = { _ipg => 200, _sacat => $native_query, }; return $self->SUPER::_native_setup_search($native_query, $rhOptsArg); } # _native_setup_search sub _preprocess_results_page_OFF { my $self = shift; my $sPage = shift; # For debugging: print STDERR $sPage; exit 88; } # preprocess_results_page sub _columns_use_SUPER { my $self = shift; # This is for basic USA eBay: return qw( paypal bids price shipping enddate ); } # _columns 1; =head1 SEE ALSO To make new back-ends, see L. =head1 CAVEATS =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Maintained by Martin Thurn, C, L. =head1 LEGALESE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. =cut __END__ WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/Stores.pm0000644000000000000000000000515412114301127020116 0ustar rootroot # $Id: Stores.pm,v 1.18 2010-04-25 00:03:52 Martin Exp $ =head1 NAME WWW::Search::Ebay::Stores - backend for searching eBay Stores =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay::Stores'); my $sQuery = WWW::Search::escape_query("C-10 carded Yakface"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES The search is done against eBay Stores items only. The query is applied to TITLES only. See L for a description of the search results. =head1 SEE ALSO To make new back-ends, see L. =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. Some fixes along the way contributed by Troy Davis. =head1 LICENSE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn =cut package WWW::Search::Ebay::Stores; use strict; use warnings; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 1.18 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; sub _native_setup_search { my ($self, $sQuery, $rh) = @_; # As of 2004-10-20: # 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 # simplest = http://search.stores.ebay.com/search/search.dll?socurrencydisplay=1&sasaleclass=1&sorecordsperpage=100&sotimedisplay=1&socolumnlayout=2&satitle=star+wars+lego # As of 2005-08-29: # http://search.stores.ebay.com/search/search.dll?satitle=093624-69602-5 $rh->{'search_host'} = 'http://search.stores.ebay.com'; $rh->{'search_path'} = '/search/search.dll'; $rh->{'satitle'} = $sQuery; # Turn off default W::S::Ebay options: $self->{_options} = {}; return $self->SUPER::_native_setup_search($sQuery, $rh); } # _native_setup_search sub _preprocess_results_page_OFF { my $self = shift; my $sPage = shift; # print STDERR Dumper($self->{response}); # For debugging: print STDERR $sPage; exit 88; } # _preprocess_results_page sub _columns_same_as_base_ebay { my $self = shift; # This is for Stores: return qw( paypal bids price enddate ); } # _columns 1; __END__ WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/BuyItNow.pm0000644000000000000000000000415412204761505020370 0ustar rootroot # $Id: BuyItNow.pm,v 1.16 2013-06-23 18:31:15 martin Exp $ =head1 NAME WWW::Search::Ebay::BuyItNow - backend for searching eBay Buy-It-Now items =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay::BuyItNow'); my $sQuery = WWW::Search::escape_query("jawa"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES The search is done against eBay Buy-It-Now items only. The query is applied to TITLES only. In the resulting WWW::Search::Result objects, the description field consists of a human-readable combination (joined with semicolon-space) of the Item Number; number of bids; and high bid amount (or starting bid amount). =head1 SEE ALSO To make new back-ends, see L. =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. =head1 LICENSE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn =cut package WWW::Search::Ebay::BuyItNow; use strict; use warnings; use WWW::Search::Ebay; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 1.16 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; sub _native_setup_search { my ($self, $sQuery, $rh) = @_; # http://shop.ebay.com/items/_W0QQLHQ5fBINZ1QQLHQ5fIncludeSIFZ1?_nkw=Burkina+Faso+flag&_sacat=0&_fromfsb=&_trksid=m270.l1313&_odkw=Burkina+Faso&_osacat=0 # http://shop.ebay.com/items/_W0QQLHQ5fBINZ1QQLHQ5fIncludeSIFZ1?_nkw=Burkina+Faso+flag $self->{search_host} = q{http://shop.ebay.com}; $self->{search_path} = q{/items/_W0QQLHQ5fBINZ1}; $self->{'_options'} = { '_nkw' => $sQuery, }; return $self->SUPER::_native_setup_search($sQuery, $rh); } # _native_setup_search sub _columns { my $self = shift; return qw( price ); } # _columns 1; __END__ WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/Motors.pm0000644000000000000000000000522712401221144020122 0ustar rootroot # $Id: Motors.pm,v 1.20 2014-09-02 01:50:28 Martin Exp $ =head1 NAME WWW::Search::Ebay::Motors - backend for searching eBay Motors =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay::Motors'); my $sQuery = WWW::Search::escape_query("Buick Star Wars"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION This class is a Ebay Motors specialization of WWW::Search. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES Same as L. =head1 OPTIONS Same as L. =head1 SEE ALSO To make new back-ends, see L. =head1 CAVEATS =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. =head1 LEGALESE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. =cut ##################################################################### package WWW::Search::Ebay::Motors; use strict; use warnings; use Carp; use Data::Dumper; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 1.20 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; our $MAINTAINER = 'Martin Thurn '; sub _native_setup_search { my ($self, $native_query, $rhOptsArg) = @_; $rhOptsArg ||= {}; if (ref($rhOptsArg) ne 'HASH') { carp " --- second argument to _native_setup_search should be hashref"; return; } # unless # As of 2013-03: # http://motors.shop.ebay.com/eBay-Motors-/6000/i.html?_nkw=bugatti&_trksid=p2050890.m570.l1313&_rdc=1 $rhOptsArg->{search_host} = 'http://motors.shop.ebay.com'; $rhOptsArg->{search_path} = '/eBay-Motors-/6000/i.html'; $self->{_options} = { _nkw => $native_query, _armrs => 1, # _trksid => 'p2050890.m570.l1313', # Turn off JavaScript: _jsoff => 1, # Search AUCTIONS ONLY: LH_Auction => 1, _ipg => $self->{_hits_per_page}, _rdc => 1, }; return $self->SUPER::_native_setup_search($native_query, $rhOptsArg); } # _native_setup_search sub _columns { my $self = shift; return qw( price bids junk enddate ); } # _columns 1; __END__ WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/ByEndDate.pm0000644000000000000000000001356112534653150020453 0ustar rootroot# Ebay/ByEndDate.pm # by Martin Thurn # $Id: ByEndDate.pm,v 2.33 2015-06-06 20:22:00 Martin Exp $ =head1 NAME WWW::Search::Ebay::ByEndDate - backend for searching www.ebay.com, with results sorted with "items ending first" =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay::ByEndDate'); my $sQuery = WWW::Search::escape_query("C-10 carded Yakface"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES The calling program must ensure that the Date::Manip module is able to determine the local timezone. When Date::Manip changed from version 5 to version 6, the timezone handling was completely overhauled. See the documentation of Date::Manip but good luck because it is VERY confusing and does not contain useful examples. The search is done against CURRENT running auctions only. The query is applied to TITLES only. The results are ordered auctions ending soon first (order of increasing auction ending date). In the resulting WWW::Search::Result objects, the description field consists of a human-readable combination (joined with semicolon-space) of the Item Number; number of bids; and high bid amount (or starting bid amount). In the WWW::Search::Result objects, the change_date field contains the auction ending date & time in ISO 8601 format; i.e. YYYY-MM-DDThh:mm:ss. =head1 SEE ALSO To make new back-ends, see L. =head1 CAVEATS =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. =head1 LEGALESE Copyright (C) 1998-2015 Martin 'Kingpin' Thurn THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. =cut ##################################################################### package WWW::Search::Ebay::ByEndDate; use strict; use warnings; use Carp; use Data::Dumper; use Date::Manip; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 2.33 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; our $MAINTAINER = 'Martin Thurn '; my $EBAY_TZ = 'America/Los_Angeles'; # private sub _native_setup_search { my ($self, $native_query, $rhOptsArg) = @_; $rhOptsArg ||= {}; unless (ref($rhOptsArg) eq 'HASH') { carp " --- second argument to _native_setup_search should be hashref, not arrayref"; return undef; } # unless $rhOptsArg->{'SortProperty'} = 'MetaEndSort'; if (0) { # my @a = sort Date_Init(); # print STDERR " III BEFORE: ", Dumper(\@a); Date_Init("ConvTZ=$EBAY_TZ"); # @a = sort Date_Init(); # print STDERR " III AFTER: ", Dumper(\@a); # We need to know the time in eBayLand right now: my $tz = $Date::Manip::Cnf{TZ}; # UnixDate('today', '%Z'); } # if 0 # Get the date-time right now, in the local timezone: my $dateToday = ParseDate('today'); # Date_Init("SetDate=$EBAY_TZ"); # Date::Manip::DM6 says it will "default to the local timezone": my $tz = undef; # print STDERR " DDD convert today ==$dateToday== to tz ==$EBAY_TZ==\n"; $self->{_today_} = Date_ConvTZ($dateToday, $tz, $EBAY_TZ); # print STDERR " DDD result today == ", $self->{_today_}, "\n"; # exit; return $self->SUPER::_native_setup_search($native_query, $rhOptsArg); } # _native_setup_search # Enforce sorting by end date, even if Ebay is returning it in a # different order. (They will be out of order if there are "Featured # Items" at the top of the page.) Calls _parse_tree() of the base # class, and then reshuffles its 'cache' results. Code contributed by # Mike Schilli. sub _parse_tree { my ($self, @args) = @_; my $hits = $self->SUPER::_parse_tree(@args); $self->{cache} ||= []; if (0) { # Convert all eBay relative times to absolute times: $self->{cache} = [ map { my $iMin = _minutes($_->change_date) || _minutes(_date_to_rel($_->change_date, $self->{_today_})); $_->change_date(UnixDate(DateCalc($self->{_today_}, " + $iMin minutes"), '%Y-%m-%dT%H:%M:%S')); $_ } grep { ref } @{$self->{cache}} ]; } # if # Sort by date using a Schwartzian transform to save memory: $self->{cache} = [ map { $_->[0] } sort { $a->[1] cmp $b->[1] } map { [ $_, $_->change_date ] } @{$self->{cache}} ]; return $hits; } # _parse_tree use constant DEBUG_MINUTES => 0; sub _minutes { my $s = shift; DEBUG_MINUTES && print STDERR " III _minutes($s)...\n"; my $min = 0; $min += 60*24*$1 if $s =~ /(\d+)\s?[dT]/; $min += 60*$1 if $s =~ /(\d+)\s?[hS]/; $min += $1 if $s =~ /(\d+)\s?[mM]/; DEBUG_MINUTES && print STDERR " min=$min=\n"; return $min; } # _minutes sub _date_to_rel { my $string = shift; my $today = shift; DEBUG_MINUTES && print STDERR " III _date_to_rel($string)...\n"; my $date = ParseDate($string) || ''; DEBUG_MINUTES && print STDERR " raw date =$date=...\n"; my $delta = DateCalc($today, $date) || 0; DEBUG_MINUTES && print STDERR " delta =$delta=...\n"; # Convert to minutes: my $iMin = int(&Delta_Format($delta, 0, '%mt')); my $result = "$iMin min"; DEBUG_MINUTES && print STDERR " result =$result=...\n"; return $result; } # _date_to_rel 1; __END__ WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/BySellerID.pm0000644000000000000000000000546212401164725020611 0ustar rootroot # $Id: BySellerID.pm,v 2.14 2014-09-01 21:49:09 Martin Exp $ =head1 NAME WWW::Search::Ebay::BySellerID - backend for searching eBay for items offered by a particular seller =head1 SYNOPSIS use WWW::Search; my $oSearch = new WWW::Search('Ebay::BySellerID'); my $sQuery = WWW::Search::escape_query("martinthurn"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; } =head1 DESCRIPTION See L for details. The query string must be an eBay seller ID. This class is an Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches F. This class exports no public interface; all interaction should be done through L objects. =head1 NOTES Searches only for items offered by eBay sellers whose ID matches exactly. See L for explanation of the results. =head1 SEE ALSO To make new back-ends, see L. =head1 BUGS Please tell the author if you find any! =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. =head1 LICENSE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn =cut package WWW::Search::Ebay::BySellerID; use strict; use warnings; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 2.14 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; sub _native_setup_search { my ($self, $sQuery, $rh) = @_; # As of 2013-03: # http://www.ebay.com/sch/allhypedup82/m.html?_ipg=200&_sop=1&_rdc=1 $rh->{search_host} = 'http://www.ebay.com'; $rh->{search_path} = qq'/sch/$sQuery/m.html'; $self->{_options} = { _ipg => $self->{_hits_per_page}, _rdc => 1, _sop => 1, }; return $self->SUPER::_native_setup_search($sQuery, $rh); # Old version: $rh->{'MfcISAPICommand'} = 'MemberSearchResult'; $rh->{'frompage'} = 'itemsbyseller'; $rh->{'sofindtype'} = '26'; $rh->{'userid'} = $sQuery; # $rh->{'completed'} = 1; # Also return completed auctions # $rh->{'since'} = 30; # The oldest possible # $rh->{'include'} = 1; # also return bidders email addresses (only # possible if you login) $rh->{'fcm'} = 0; # Whether to return "similar" user ids $rh->{'frpp'} = '200'; # Results per page $rh->{'submit'} = 'Search'; # Don't know what the rest are for: $rh->{'fcl'} = '3'; $rh->{'amp;sspagename'} = 'h:h:advsearch:US'; $rh->{'sacat'} = '-1'; $rh->{'nojspr'} = 'y'; $rh->{'catref'} = 'C5'; $rh->{'from'} = 'R7'; $rh->{'pfid'} = '0'; return $self->SUPER::_native_setup_search('', $rh); } # _native_setup_search sub _columns_NOT_NEEDED { my $self = shift; # This is for basic USA eBay: return qw( enddate price repeat bids ); } # _columns 1; __END__ WWW-Search-Ebay-3.042/lib/WWW/Search/Ebay/Auctions.pm0000644000000000000000000000111412114301127020414 0ustar rootroot # $Id: Auctions.pm,v 1.9 2010-04-25 00:03:17 Martin Exp $ =head1 NAME WWW::Search::Ebay::Auctions - backend for searching auctions at www.ebay.com =head1 DESCRIPTION This module is just a synonym of WWW::Search::Ebay. =head1 AUTHOR Martin 'Kingpin' Thurn, C, L. =head1 LICENSE Copyright (C) 1998-2009 Martin 'Kingpin' Thurn =cut package WWW::Search::Ebay::Auctions; use strict; use warnings; use base 'WWW::Search::Ebay'; our $VERSION = do { my @r = (q$Revision: 1.9 $ =~ /\d+/g); sprintf "%d."."%03d" x $#r, @r }; 1; __END__ WWW-Search-Ebay-3.042/META.yml0000644000000000000000000000155512575325670014260 0ustar rootroot--- abstract: 'backend for searching www.ebay.com' author: - "Martin 'Kingpin' Thurn, C, L." build_requires: Bit::Vector: 0 Date::Manip: 0 ExtUtils::MakeMaker: 6.36 IO::Capture::Stderr: 0 Test::More: 0 WWW::Search::Test: 2.29 configure_requires: ExtUtils::MakeMaker: 6.36 distribution_type: module dynamic_config: 1 generated_by: 'Module::Install version 1.14' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 module_name: WWW::Search::Ebay name: WWW-Search-Ebay no_index: directory: - inc - t - xt recommends: Test::Pod: 0 Test::Pod::Coverage: 0 requires: Date::Manip: 0 HTML::TreeBuilder: 0 LWP::Simple: 0 WWW::Search: 2.557 WWW::SearchResult: 2.067 perl: 5.005 resources: license: http://dev.perl.org/licenses/ version: 3.042