perldoc > WWW::Search::Ebay

🏷️ NAME

WWW::Search::Ebay - backend for searching www.ebay.com

πŸš€ Quick Reference

Use CaseCommandDescription
Basic searchmy $oSearch = new WWW::Search('Ebay');Create a search object
Escape querymy $sQuery = WWW::Search::escape_query("...");Escape special characters
Set query$oSearch->native_query($sQuery);Perform the search
Iterate resultswhile (my $oResult = $oSearch->next_result()) { ... }Loop through results
Price range limit$oSearch->native_query($sQuery, { _mPrRngCbx=>'1', _udlo=>$minPrice, _udhi=>$maxPrice });Limit by price range
Search completed auctionsuse WWW::Search::Ebay::Completed;Backend for completed auctions
Search eBay Storesuse WWW::Search::Ebay::Stores;Backend for eBay Stores

πŸ“ 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"; }

πŸ“– DESCRIPTION

This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches http://www.ebay.com.

This class exports no public interface; all interaction should be done through WWW::Search objects.

πŸ—’οΈ NOTES

Example of categories structure:

$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.

βš™οΈ OPTIONS

πŸ’° Limit search by price range

Contributed by Brian Wilson:

$oSearch->native_query($sQuery, {
  _mPrRngCbx=>'1', _udlo=>$minPrice, _udhi=>$maxPrice,
  } );

πŸ› οΈ PUBLIC METHODS OF NOTE

⏳ user_agent_delay

Introduce a few-seconds delay to avoid overwhelming the server.

⏸️ need_to_delay

Controls whether we do the delay or not.

πŸ“₯ 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.

πŸ“„ 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');

🧬 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).

πŸ” _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.

πŸ“‹ _get_itemtitle_tds

Given an HTML::TreeBuilder object, return a list of HTML::Element objects therein representing <TD> elements which could possibly contain the HTML for result title and hotlink.

πŸ“‚ _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.

πŸ“… _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'.

➑️ _next_text

The text of the "Next" button, localized for a specific type of eBay backend.

πŸ“ whitespace_pattern

Return a qr// pattern to match whitespace your webpage's language.

πŸ’² _currency_pattern

Return a qr// pattern to match mentions of money in your webpage's language. Include the digits in the pattern.

🏷️ _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.

πŸ”’ _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).

πŸ‘€ SEE ALSO

To make new back-ends, see WWW::Search.

πŸ› BUGS

Please tell the author if you find any!

πŸ‘€ AUTHOR

Martin 'Kingpin' Thurn, "mthurn at cpan.org", <http://tinyurl.com/nn67z>.

Some fixes along the way contributed by Troy Davis.

βš–οΈ 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.

πŸ“œ LICENSE

Copyright (C) 1998-2009 Martin 'Kingpin' Thurn

This software is released under the same license as Perl itself.

WWW::Search::Ebay
🏷️ NAME πŸš€ Quick Reference πŸ“ SYNOPSIS πŸ“– DESCRIPTION πŸ—’οΈ NOTES βš™οΈ OPTIONS
πŸ’° Limit search by price range
πŸ› οΈ PUBLIC METHODS OF NOTE
⏳ user_agent_delay ⏸️ need_to_delay πŸ“₯ preprocess_results_page πŸ“„ result_as_HTML
🧬 METHODS TO BE OVERRIDDEN IN SUBCLASSING
πŸ” _get_result_count_elements πŸ“‹ _get_itemtitle_tds πŸ“‚ _parse_category_list πŸ“… _process_date_abbrevs ➑️ _next_text πŸ“ whitespace_pattern πŸ’² _currency_pattern 🏷️ _title_pattern πŸ”’ _result_count_pattern
πŸ‘€ SEE ALSO πŸ› BUGS πŸ‘€ AUTHOR βš–οΈ LEGALESE πŸ“œ LICENSE

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 05:24 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^