Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    Object::eBay 0.3.2

    Download button

    No screenshots available
    Downloads: 293  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.7/5)
    10 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael Hendricks | More programs
    Perl Artistic License / FREE
    July 17th, 2008, 22:02 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Object::eBay description

    Object::eBay is a object-oriented interface to the eBay API.

    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

      


    TAGS:

    object-oriented interface | eBay API | Perl module | object-oriented | Perl | interface



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM