Agent Cooper
AgentCooper is a minimal Ruby wrapper to the eBay Web Services API.
The following eBay APIs are supported:
Installation
Add this line to your application's Gemfile:
gem "agent_cooper"
And then execute:
$ bundle install
Or install it yourself as:
$ gem install agent_cooper
Usage
First, set the app id to your eBay app id:
AgentCooper.configure do |config|
config.app_id = "YOUR_EBAY_APP_ID"
end
Initialize a request without parameters:
AgentCooper::Finder.new
Initialize a request with parameters:
AgentCooper::Shopper.new(parameters: { "KEY" => "value" })
Add parameters after initialization:
request = AgentCooper::Shopper.new
request << {
'OPERATION-NAME' => 'getSearchKeywordsRecommendation',
'KEYWORDS' => 'arry potter'
}
Perform a request:
request.get
#=> #<AgentCooper::Response:0x007ffd5c2ca040 @response="...">
Return a hash:
response = request.get
response.to_hash
#=> {'getSearchKeywordsRecommendationResponse' => {'xmnls' => 'http://www.ebay.com/marketplace/search/v1/services', 'ack' => 'Success', 'version' => '1.9.0', 'keywords' => 'harry potter'}}
Contributing
- Fork it ( http://github.com/rclosner/agent_cooper/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request