.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "WWW::Search::Ebay 3pm" .TH WWW::Search::Ebay 3pm "2018-11-25" "perl v5.28.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" WWW::Search::Ebay \- backend for searching www.ebay.com .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 6 \& use WWW::Search; \& my $oSearch = new WWW::Search(\*(AqEbay\*(Aq); \& my $sQuery = WWW::Search::escape_query("C\-10 carded Yakface"); \& $oSearch\->native_query($sQuery); \& while (my $oResult = $oSearch\->next_result()) \& { print $oResult\->url, "\en"; } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches \&\fIhttp://www.ebay.com\fR. .PP This class exports no public interface; all interaction should be done through WWW::Search objects. .SH "NOTES" .IX Header "NOTES" The search is done against \s-1CURRENT\s0 running \s-1AUCTIONS\s0 only. (\s-1NOT\s0 completed auctions, \s-1NOT\s0 eBay Stores items, \s-1NOT\s0 Buy-It-Now only items.) (If you want to search completed auctions, use the WWW::Search::Ebay::Completed module.) (If you want to search eBay Stores, use the WWW::Search::Ebay::Stores module.) .PP The query is applied to \s-1TITLES\s0 only. .PP This module can return only the first 200 results matching your query. .PP In the resulting WWW::Search::Result objects, the \fBdescription()\fR 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). .PP In the resulting WWW::Search::Result objects, the \fBend_date()\fR field contains a human-readable \s-1DTG\s0 of when the auction is scheduled to end (in the form \*(L"YYYY-MM-DD \s-1HH:MM TZ\*(R"\s0). If environment variable \s-1TZ\s0 is set, the time will be converted to that timezone; otherwise the time will be left in ebay.com's default timezone (US/Pacific). .PP In the resulting WWW::Search::Result objects, the \fBbid_count()\fR field contains the number of bids as an integer. .PP In the resulting WWW::Search::Result objects, the \fBbid_amount()\fR field is a string containing the high bid or starting bid as a human-readable monetary value in seller-native units, e.g. \*(L"$14.95\*(R" or \&\*(L"\s-1GBP 6.00\*(R".\s0 .PP In the resulting WWW::Search::Result objects, the \fBsold()\fR field will be non-zero if the item has already sold. (Only if you're using WWW::Search::Ebay::Completed) .PP 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: .PP .Vb 10 \& $oSearch\->{categories} = [ \& { \& \*(AqID\*(Aq => \*(Aq1\*(Aq, \& \*(AqCount\*(Aq => 19, \& \*(AqName\*(Aq => \*(AqCollectibles\*(Aq, \& \*(AqSubcategory\*(Aq => [ \& { \& \*(AqID\*(Aq => \*(Aq13877\*(Aq, \& \*(AqCount\*(Aq => 11, \& \*(AqName\*(Aq => \*(AqHistorical Memorabilia\*(Aq \& }, \& { \& \*(AqID\*(Aq => \*(Aq11450\*(Aq, \& \*(AqCount\*(Aq => 1, \& \*(AqName\*(Aq => \*(AqClothing, Shoes & Accessories\*(Aq \& }, \& ] \& }, \& { \& \*(AqID\*(Aq => \*(Aq281\*(Aq, \& \*(AqCount\*(Aq => 1, \& \*(AqName\*(Aq => \*(AqJewelry & Watches\*(Aq, \& } \& ]; .Ve .PP 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. .SH "OPTIONS" .IX Header "OPTIONS" .IP "Limit search by price range" 4 .IX Item "Limit search by price range" Contributed by Brian Wilson: .Sp .Vb 3 \& $oSearch\->native_query($sQuery, { \& _mPrRngCbx=>\*(Aq1\*(Aq, _udlo=>$minPrice, _udhi=>$maxPrice, \& } ); .Ve .SH "PUBLIC METHODS OF NOTE" .IX Header "PUBLIC METHODS OF NOTE" .IP "user_agent_delay" 4 .IX Item "user_agent_delay" Introduce a few-seconds delay to avoid overwhelming the server. .IP "need_to_delay" 4 .IX Item "need_to_delay" Controls whether we do the delay or not. .IP "preprocess_results_page" 4 .IX Item "preprocess_results_page" Grabs the eBay Official Time so that when we parse the \s-1DTG\s0 from the \&\s-1HTML,\s0 we can convert / return exactly what eBay means for each one. .IP "result_as_HTML" 4 .IX Item "result_as_HTML" Given a WWW::SearchResult object representing an auction, formats it human-readably with \s-1HTML.\s0 .Sp An optional second argument is the date format, a string as specified for Date::Manip::UnixDate. Default is '%Y\-%m\-%d \f(CW%H:\fR%M:%S' .Sp .Vb 1 \& my $sHTML = $oSearch\->result_as_HTML($oSearchResult, \*(Aq%H:%M %b %E\*(Aq); .Ve .SH "METHODS TO BE OVERRIDDEN IN SUBCLASSING" .IX Header "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). .IP "_get_result_count_elements" 4 .IX 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. .IP "_get_itemtitle_tds" 4 .IX Item "_get_itemtitle_tds" Given an HTML::TreeBuilder object, return a list of HTML::Element objects therein representing <\s-1TD\s0> elements which could possibly contain the \s-1HTML\s0 for result title and hotlink. .IP "_parse_category_list" 4 .IX 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. .IP "_process_date_abbrevs" 4 .IX 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'. .IP "_next_text" 4 .IX Item "_next_text" The text of the \*(L"Next\*(R" button, localized for a specific type of eBay backend. .IP "whitespace_pattern" 4 .IX Item "whitespace_pattern" Return a qr// pattern to match whitespace your webpage's language. .IP "_currency_pattern" 4 .IX Item "_currency_pattern" Return a qr// pattern to match mentions of money in your webpage's language. Include the digits in the pattern. .IP "_title_pattern" 4 .IX Item "_title_pattern" Return a qr// pattern to match the webpage title in your webpage's language. Add grouping parenthesis so that \&\f(CW$1\fR becomes the auction title, \&\f(CW$2\fR becomes the eBay item number, and \&\f(CW$3\fR becomes the end date. .IP "_result_count_pattern" 4 .IX Item "_result_count_pattern" Return a qr// pattern to match the result count in your webpage's language. Include parentheses so that \f(CW$1\fR becomes the number (with commas is \s-1OK\s0). .SH "SEE ALSO" .IX Header "SEE ALSO" To make new back-ends, see WWW::Search. .SH "BUGS" .IX Header "BUGS" Please tell the author if you find any! .SH "AUTHOR" .IX Header "AUTHOR" Martin 'Kingpin' Thurn, \f(CW\*(C`mthurn at cpan.org\*(C'\fR, . .PP Some fixes along the way contributed by Troy Davis. .SH "LEGALESE" .IX Header "LEGALESE" \&\s-1THIS SOFTWARE IS PROVIDED \*(L"AS IS\*(R" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\s0 .SH "LICENSE" .IX Header "LICENSE" Copyright (C) 1998\-2009 Martin 'Kingpin' Thurn .PP This software is released under the same license as Perl itself.