WWW::Search::EBayGlobal - backend for searching www.ebay.co.uk and european eBay sites
use WWW::Search; my $oSearch = new WWW::Search('EBayGlobal'); my $sQuery = WWW::Search::escape_query("Bovine Spongiform Encephalitis"); $oSearch->native_query($sQuery); while (my $oResult = $oSearch->next_result()) { print $oResult->url, "\n"; print $oResult->title, "\n"; print $oResult->description, "\n"; }
This class is a Ebay specialization of WWW::Search. It handles making and interpreting Ebay searches http://www.ebay.co.uk.
This class exports no public interface; all interaction should be done through WWW::Search objects.
The search is done against CURRENT running auctions only.
The query is applied to TITLES only. See below for retrieving html from links.
The results are ordered youngest auctions first (reverse order of auction listing 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).
Extra information is available by following the links returned by:
following
$oResult->url
In such an instance extra information is returned that is not normally accessible from the result page. To cater for this, an extra details method is introduced:
$oResult->details
Which stores the extra information in a hash.
To search titles and descriptions, add 'srchdesc' => 'y' to the query options:
$oSearch->native_query($sQuery, { srchdesc => 'y' } );
As of version 3.00 WWW::Search::EBayGlobal can be used to search the following european ebay sites http://www.ebay.co.uk (United Kingdom) http://www.ebay.at (Austria) http://www.ebay.com.au (Australia) http://pages.ca.ebay.com (Canada) http://www.ebay.ch (Switzerland) http://www.ebay.de (Germany) http://pages.ebay.fr (France) http://www.ebay.com (United States)
The search defaults to the UK website but the other sites above can be queried by setting ebay_site = (at|au|ca|ch|de|fr|us) in the native_query options:
ebay_site
$oSearch->native_query($sQuery, { ebay_site => 'at' } );
To search across the world, set World_Wide = 'y' in the query options:
World_Wide
$oSearch->native_query($sQuery, { World_Wide => 'y' } );
The search defaults to '2' which is the local website.
To retrieve information from a specific ebay link, add 'follow_link' => '<http:// full URL>' to the query options:
$sURL = '<http:// full URL>'; $oSearch->native_query($sURL, { follow_link => "$sURL" } );
No escaping is required in this case.
Extra information is returned by this process. (Auction Start and End dates are a case in point.) Query the $oResult->details hash to retrieve this. E.g. the start date of the auction is retrieved like so:
print $oResult->details->{'Start'}, "\n";
To make new back-ends, see WWW::Search.
The Belgian site has an extra layer to allow users to select Netherlands or France. It would be nice to be able to incorporate a workaround in future releases.
Doubt it. Please tell me if you find any!
WWW::Search::EBayGlobal was Adapted by Andy Pritchard from Martin Thurn's Ebay module (pilchkinstein@hotmail.com).
WWW::Search::EBayGlobal
Original WWW::Search::Ebay was written by Martin Thurn (mthurn@megapipe.net).
WWW::Search::Ebay
WWW::Search::EBayGlobal is maintained by Andy Pritchard
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.
Added ebay_site and World_Wide functionality to allow use of this module with other e-Bay websites.
Altered Makefile.PL Prerequisites
Added follow_link functionality and new details method. This also supports the raw and title calls.
follow_link
Adapted Ebay module for ebay.co.uk site
Fixed parsing for slightly-changed ebay.com pages
Fixed parsing for Buy-It-Now prices, and foreign currencies
Fixed parsing for new images in the results table
Restructured using parse_tree()
Handle new ebay.com output format
First publicly-released version.
To install WWW::Search::EBayGlobal, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Search::EBayGlobal
CPAN shell
perl -MCPAN -e shell install WWW::Search::EBayGlobal
For more information on module installation, please visit the detailed CPAN module installation guide.