Object::eBay is a object-oriented interface to the eBay API.
SYNOPSIS
use Object::eBay;
my $ebay = # ... create a Net::eBay object ...
Object::eBay->init($ebay);
my $item = Object::eBay::Item->new({ item_id => 12345678 });
my $title = $item->title();
my $price = $item->selling_status->current_price();
print "Item titled '$title' is going for $pricen"
Object::eBay provides an object-oriented interface to the eBay API. Objects are created to represent entities dealing with eBay such as items, users, etc. You won't want to create objects of the class Object::eBay but rather of its subclasses such as: Object::eBay::Item or Object::eBay::User. eBay API calls are processed using the Perl module Net::eBay (available from CPAN or from http://www.net-ebay.org).
Object::eBay follows some simple rules to make the names of eBay API objects more "Perlish." Namely, for packages, eBay's camelcase is retained. For example Object::eBay::ListingDetails. For attribute names, the camelcase is converted to underscore separated method names with roughly the following algorithm:
Before each capital letter after the first one, place an underscore
Make all letters lowercase
So, eBay's "FeedbackScore" becomes the method name "feedback_score". Generally, the transformation algorithm does what you'd expect. Attributes like "ItemID" become "item_id" as anticipated.
PUBLIC METHODS
The following methods are intended for general use.
init
Object::eBay->init($net_ebay_object);
Requires a single Net::eBay object as an argument. This class method must be called before creating any Object::eBay objects. The Net::eBay object provided to init should be initialized and ready to perform eBay API calls. All Object::eBay objects will use this Net::eBay object.
new
This documentation covers functionality that is common to the new method of all Object::eBay classes. For details for specific class, see the appropriate class documentation. The new constructor tries to be as lazy as possible and will not invoke an eBay API call until it's really necessary.
Generally this happens when the first method is invoked on a new object. After that, cached values from the API call are returned. That means, each object should only cost use API call and that only if you call a method on the object.
The new method constructs a new object. It accepts a single hashref as an argument. Each subclass determines the values that are accepted or required. However, new always accepts a key named 'needs_methods' to indicate which expensive methods you plan to use. The value of this key should be an arrayref containing the names of the expensive methods you intend to call with the newly created object.
Some eBay API calls return a lot of data, for example, the description of an item can be quite large. To avoid a performance penalty for programs that don't use these expensive methods, Object::eBay avoids fetching the data unless you really need it. You indicate to Object::eBay that you plan to use an expensive method by specifying it with the 'needs_methods' argument. Here's an example where we intend to access an item's description:
my $item = Object::eBay::Item->new({
item_id => 123456789,
needs_methods => [qw( description )],
});
Expensive methods indicate this in their documention so that you know in advance. Take a look at "description" in Object::eBay::Item for example.
Product's homepage
Requirements:
· Perl