agent_cooper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +48 -0
- data/lib/agent_cooper/finder.rb +2 -0
- data/lib/agent_cooper/request.rb +4 -0
- data/lib/agent_cooper/response.rb +4 -0
- data/lib/agent_cooper/shopper.rb +1 -5
- data/lib/agent_cooper/version.rb +1 -1
- metadata +5 -5
- data/VERSION +0 -3
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
Agent Cooper
|
2
|
+
======
|
3
|
+
|
4
|
+
Agent Cooper is a minimalistic, Nokogiri-based Ruby wrapper to the [eBay Web Services API](http://developer.ebay.com/).
|
5
|
+
|
6
|
+
Currently the following eBay APIs are supported:
|
7
|
+
- [Finding API](http://developer.ebay.com/products/finding/)
|
8
|
+
- [Shopping API](http://developer.ebay.com/products/shopping/)
|
9
|
+
- [Merchandising API](http://developer.ebay.com/products/merchandising/)
|
10
|
+
|
11
|
+
Usage
|
12
|
+
-----
|
13
|
+
Set up.
|
14
|
+
|
15
|
+
AgentCooper::Request::APP_ID = YOUR_APP_ID
|
16
|
+
|
17
|
+
Initialize a request
|
18
|
+
|
19
|
+
request = AgentCooper::Finder.new
|
20
|
+
request = AgentCooper::Shopper.new
|
21
|
+
request = AgentCooper::Merchandiser.new
|
22
|
+
|
23
|
+
Build request params.
|
24
|
+
|
25
|
+
request << {
|
26
|
+
'OPERATION-NAME' => 'findItemsByKeywords',
|
27
|
+
'keywords' => 'harry potter'
|
28
|
+
}
|
29
|
+
|
30
|
+
Get a response.
|
31
|
+
|
32
|
+
response = request.get
|
33
|
+
|
34
|
+
Response API allows one to utilize the pure goodness of Nokogiri:
|
35
|
+
|
36
|
+
response.xml.css("Item > Title").each do |title|
|
37
|
+
some business value
|
38
|
+
end
|
39
|
+
|
40
|
+
response.xml.xpath("//Item")
|
41
|
+
|
42
|
+
Specify a particular eBay locale (defaults to US):
|
43
|
+
|
44
|
+
AgentCooper::Shopper.new(:locale => :fr)
|
45
|
+
|
46
|
+
----
|
47
|
+
|
48
|
+
Based on papercavalier's [sucker](http://github.com/papercavalier/sucker).
|
data/lib/agent_cooper/finder.rb
CHANGED
data/lib/agent_cooper/request.rb
CHANGED
data/lib/agent_cooper/shopper.rb
CHANGED
@@ -6,16 +6,12 @@ module AgentCooper
|
|
6
6
|
|
7
7
|
protected
|
8
8
|
|
9
|
-
def site_id
|
10
|
-
LOCALE_CODES[locale]
|
11
|
-
end
|
12
|
-
|
13
9
|
def options
|
14
10
|
{
|
15
11
|
'APPID' => APP_ID,
|
16
12
|
'RESPONSEENCODING' => ENCODING,
|
17
13
|
'VERSION' => VERSION,
|
18
|
-
'SITEID' =>
|
14
|
+
'SITEID' => locale_code
|
19
15
|
}.merge(parameters)
|
20
16
|
end
|
21
17
|
|
data/lib/agent_cooper/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agent_cooper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Closner
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-24 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -191,8 +191,8 @@ extra_rdoc_files: []
|
|
191
191
|
files:
|
192
192
|
- .gitignore
|
193
193
|
- Gemfile
|
194
|
+
- README.md
|
194
195
|
- Rakefile
|
195
|
-
- VERSION
|
196
196
|
- agent_cooper.gemspec
|
197
197
|
- features/finder.feature
|
198
198
|
- features/merchandiser.feature
|
data/VERSION
DELETED