eBay::API::Simple::JSON - Support for grabbing an RSS feed via API call
my $api = eBay::API::Simple::JSON->new(); my $data = { "user_eais_token" => "tim", "body_text" => "mytext", "foo" => "bar", "greener_alt_topic" => "/green/api/v1/greenerAlternativeTopic/2/", "items"=> [ { "ebay_item_id"=> "250814913221", "photo"=> "http=>//thumbs2.ebaystatic.com/m/m9X7sXOK303v4e_fgxm_-7w/140.jpg", "price"=> 2.96, "title"=> "TEST PUT - VAPUR 16 OZ FLEXIBLE FOLDABLE WATER BOTTLE BPA FREE" } ], "meta_title"=> "Foldable bottles can be stashed away when the water is gone", "title"=> "TEST PUT - Foldable bottles can be stashed away when the water is gone" }; $api->execute( 'http://localhost-django-vm.ebay.com/green/api/v1/greenerAlternative/', $data ); print $api->request_content() ."\n"; if ( $api->has_error() ) { print "FAILED: " . $api->response_content(); #print "FAILED: " . $api->response_hash->{error_message} . "\n"; } else { print "SUCCESS!\n"; print $api->response_object->header('Location') . "\n"; } my $hash = $call->response_hash(); # execution methods for "GET", "POST", "PUT", and "DELETE" requests $api->get( $endpoint ); $api->post( $endpoint, data ); $api->put( $endpoint, $data ); $api->delete( $endpoint );
my $call = ebay::API::Simple::JSON->new();
$call->prepare( 'http://sfbay.craigslist.org/search/sss', { query => 'shirt', format => 'rss', } );
This method will construct the API request using the supplied URL.
Feed URL to fetch
The supplied args will be encoded and appended to the URL
This method will process the API response.
execute a "GET" request to the specified endpoint
execute a "POST" request to the specified endpoint
execute a "PUT" request to the specified endpoint
execute a "DELETE" request to the specified endpoint
Accessor for the LWP::UserAgent request agent
Accessor for the HTTP::Request request object
Accessor for the complete request body from the HTTP::Request object
Accessor for the HTTP response body content
Accessor for the HTTP::Response response object
Accessor for the LibXML response DOM
Accessor for the hashified response content
Accessor for the json response content
Helper for LibXML that retrieves node content
Accessor to the hashref of errors
Returns true if the call contains errors
Returns a string of API errors if there are any.
This method supplies the JSON body for the web service request
This methods supplies the headers for the RSS API call
This method creates the request object and returns to the parent class
Tim Keefer <tim@timkeefer.com>
Tim Keefer 2009
To install eBay::API::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm eBay::API::Simple
CPAN shell
perl -MCPAN -e shell install eBay::API::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.