{
    "content": [
        {
            "type": "text",
            "text": "# WWW::Search::Ebay (perldoc)\n\n## NAME\n\nWWW::Search::Ebay - backend for searching www.ebay.com\n\n## SYNOPSIS\n\nuse WWW::Search;\nmy $oSearch = new WWW::Search('Ebay');\nmy $sQuery = WWW::Search::escapequery(\"C-10 carded Yakface\");\n$oSearch->nativequery($sQuery);\nwhile (my $oResult = $oSearch->nextresult())\n{ print $oResult->url, \"\\n\"; }\n\n## DESCRIPTION\n\nThis class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay\nsearches http://www.ebay.com.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **NOTES**\n- **OPTIONS**\n- **PUBLIC METHODS OF NOTE**\n- **METHODS TO BE OVERRIDDEN IN SUBCLASSING**\n- **SEE ALSO**\n- **BUGS**\n- **AUTHOR**\n- **LEGALESE**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "WWW::Search::Ebay",
        "section": "",
        "mode": "perldoc",
        "summary": "WWW::Search::Ebay - backend for searching www.ebay.com",
        "synopsis": "use WWW::Search;\nmy $oSearch = new WWW::Search('Ebay');\nmy $sQuery = WWW::Search::escapequery(\"C-10 carded Yakface\");\n$oSearch->nativequery($sQuery);\nwhile (my $oResult = $oSearch->nextresult())\n{ print $oResult->url, \"\\n\"; }",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 61,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "PUBLIC METHODS OF NOTE",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "METHODS TO BE OVERRIDDEN IN SUBCLASSING",
                "lines": 41,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "LEGALESE",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "WWW::Search::Ebay - backend for searching www.ebay.com\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use WWW::Search;\nmy $oSearch = new WWW::Search('Ebay');\nmy $sQuery = WWW::Search::escapequery(\"C-10 carded Yakface\");\n$oSearch->nativequery($sQuery);\nwhile (my $oResult = $oSearch->nextresult())\n{ print $oResult->url, \"\\n\"; }\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay\nsearches http://www.ebay.com.\n\nThis class exports no public interface; all interaction should be done through WWW::Search\nobjects.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "The search is done against CURRENT running AUCTIONS only. (NOT completed auctions, NOT eBay\nStores items, NOT Buy-It-Now only items.) (If you want to search completed auctions, use the\nWWW::Search::Ebay::Completed module.) (If you want to search eBay Stores, use the\nWWW::Search::Ebay::Stores module.)\n\nThe query is applied to TITLES only.\n\nThis module can return only the first 200 results matching your query.\n\nIn the resulting WWW::Search::Result objects, the description() field consists of a\nhuman-readable combination (joined with semicolon-space) of the Item Number; number of bids; and\nhigh bid amount (or starting bid amount).\n\nIn the resulting WWW::Search::Result objects, the enddate() field contains a human-readable DTG\nof when the auction is scheduled to end (in the form \"YYYY-MM-DD HH:MM TZ\"). If environment\nvariable TZ is set, the time will be converted to that timezone; otherwise the time will be left\nin ebay.com's default timezone (US/Pacific).\n\nIn the resulting WWW::Search::Result objects, the bidcount() field contains the number of bids\nas an integer.\n\nIn the resulting WWW::Search::Result objects, the bidamount() field is a string containing the\nhigh bid or starting bid as a human-readable monetary value in seller-native units, e.g.\n\"$14.95\" or \"GBP 6.00\".\n\nIn the resulting WWW::Search::Result objects, the sold() field will be non-zero if the item has\nalready sold. (Only if you're using WWW::Search::Ebay::Completed)\n\nAfter a successful search, your search object will contain an element named 'categories' which\nwill be a reference to an array of hashes containing names and IDs of categories and nested\nsubcategories, and the count of items matching your query in each category and subcategory.\n(Special thanks to Nick Lokkju for this code!) For example:\n\n$oSearch->{categories} = [\n{\n'ID' => '1',\n'Count' => 19,\n'Name' => 'Collectibles',\n'Subcategory' => [\n{\n'ID' => '13877',\n'Count' => 11,\n'Name' => 'Historical Memorabilia'\n},\n{\n'ID' => '11450',\n'Count' => 1,\n'Name' => 'Clothing, Shoes & Accessories'\n},\n]\n},\n{\n'ID' => '281',\n'Count' => 1,\n'Name' => 'Jewelry & Watches',\n}\n];\n\nIf your query string happens to be an eBay item number, (i.e. if ebay.com redirects the query to\nan auction page), you will get back one WWW::Search::Result without bid or price information.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "Limit search by price range\nContributed by Brian Wilson:\n\n$oSearch->nativequery($sQuery, {\nmPrRngCbx=>'1', udlo=>$minPrice, udhi=>$maxPrice,\n} );\n",
                "subsections": []
            },
            "PUBLIC METHODS OF NOTE": {
                "content": "useragentdelay\nIntroduce a few-seconds delay to avoid overwhelming the server.\n\nneedtodelay\nControls whether we do the delay or not.\n\npreprocessresultspage\nGrabs the eBay Official Time so that when we parse the DTG from the HTML, we can convert /\nreturn exactly what eBay means for each one.\n\nresultasHTML\nGiven a WWW::SearchResult object representing an auction, formats it human-readably with\nHTML.\n\nAn optional second argument is the date format, a string as specified for\nDate::Manip::UnixDate. Default is '%Y-%m-%d %H:%M:%S'\n\nmy $sHTML = $oSearch->resultasHTML($oSearchResult, '%H:%M %b %E');\n",
                "subsections": []
            },
            "METHODS TO BE OVERRIDDEN IN SUBCLASSING": {
                "content": "You only need to read about these if you are subclassing this module (i.e. making a backend for\nanother flavor of eBay search).\n\ngetresultcountelements\nGiven an HTML::TreeBuilder object, return a list of HTML::Element objects therein which\ncould possibly contain the approximate result count verbiage.\n\ngetitemtitletds\nGiven an HTML::TreeBuilder object, return a list of HTML::Element objects therein\nrepresenting <TD> elements which could possibly contain the HTML for result title and\nhotlink.\n\nparsecategorylist\nParses the Category list from the left side of the results page. So far, this method can\nhandle every type of eBay search currently implemented. If you find that it doesn't suit\nyour needs, please contact the author because it's probably just a tiny tweak that's needed.\n\nprocessdateabbrevs\nGiven a date string, converts common abbreviations to their full words (so that the string\ncan be unambiguously parsed by Date::Manip). For example, in the default English, 'd'\nbecomes 'days'.\n\nnexttext\nThe text of the \"Next\" button, localized for a specific type of eBay backend.\n\nwhitespacepattern\nReturn a qr// pattern to match whitespace your webpage's language.\n\ncurrencypattern\nReturn a qr// pattern to match mentions of money in your webpage's language. Include the\ndigits in the pattern.\n\ntitlepattern\nReturn a qr// pattern to match the webpage title in your webpage's language. Add grouping\nparenthesis so that $1 becomes the auction title, $2 becomes the eBay item number, and $3\nbecomes the end date.\n\nresultcountpattern\nReturn a qr// pattern to match the result count in your webpage's language. Include\nparentheses so that $1 becomes the number (with commas is OK).\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "To make new back-ends, see WWW::Search.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Please tell the author if you find any!\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Martin 'Kingpin' Thurn, \"mthurn at cpan.org\", <http://tinyurl.com/nn67z>.\n\nSome fixes along the way contributed by Troy Davis.\n",
                "subsections": []
            },
            "LEGALESE": {
                "content": "THIS SOFTWARE IS PROVIDED \"AS IS\" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,\nWITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyright (C) 1998-2009 Martin 'Kingpin' Thurn\n\nThis software is released under the same license as Perl itself.\n",
                "subsections": []
            }
        }
    }
}