ebay 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: add_item.rb,v 1.10 2005/12/27 01:17:01 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: get_account.rb,v 1.7 2005/12/27 01:17:01 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: get_account2.rb,v 1.5 2005/12/27 01:17:01 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: get_account3.rb,v 1.5 2005/12/27 01:17:01 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+ # $Id: get_categories.rb,v 1.1 2005/12/27 01:13:46 garrydolley Exp $
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
+
6
+ require 'eBayAPI'
7
+
8
+ #
9
+ # Example of GetCategories call
10
+ #
11
+
12
+ # Put your credentials in this file
13
+ load('myCredentials.rb')
14
+
15
+ # Create new eBay caller object. Omit last argument to use live platform.
16
+ eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true)
17
+
18
+ # Call "GetCategories"
19
+ resp = eBay.GetCategories(:DetailLevel => 'ReturnAll', # Return all available info
20
+ :CategorySideID => 1, # US site
21
+ :LevelLimit => 1) # Only 1 level deep
22
+
23
+ # Report results
24
+
25
+ puts "eBay Top Level Categories for US site (Cat. Version " + resp.categoryVersion + "):"
26
+ puts ""
27
+
28
+ resp.categoryArray.category.each do |cat|
29
+ puts " Category Name : " + cat.categoryName
30
+ puts " Category ID : " + cat.categoryID
31
+ puts " Category Level: " + cat.categoryLevel
32
+ puts " Is Leaf? : " + cat.leafCategory
33
+ puts " Parent ID : " + cat.categoryParentID
34
+ puts ""
35
+ end
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+ # $Id: get_categories2.rb,v 1.2 2006/01/07 07:50:27 garrydolley Exp $
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
+
6
+ require 'eBayAPI'
7
+
8
+ #
9
+ # Example of GetCategories call for eBay Motors
10
+ #
11
+
12
+ # Put your credentials in this file
13
+ load('myCredentials.rb')
14
+
15
+ # Create new eBay caller object. Omit last argument to use live platform.
16
+ eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true, :site_id => 100)
17
+
18
+ # Call "GetCategories"
19
+ resp = eBay.GetCategories(:DetailLevel => 'ReturnAll', # Return all available info
20
+ :CategorySideID => 100, # US eBay Motors Site
21
+ :LevelLimit => 2) # 2 Levels Deep
22
+
23
+ # Report results
24
+
25
+ puts "eBay Motors Top Level Categories (Cat. Version " + resp.categoryVersion + "):"
26
+ puts ""
27
+
28
+ resp.categoryArray.category.each do |cat|
29
+ puts " Category Name : " + cat.categoryName
30
+ puts " Category ID : " + cat.categoryID
31
+ puts " Category Level: " + cat.categoryLevel
32
+ puts " Is Leaf? : " + cat.leafCategory
33
+ puts " Parent ID : " + cat.categoryParentID
34
+ puts ""
35
+ end
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: get_feedback.rb,v 1.2 2005/12/27 01:17:01 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: get_item.rb,v 1.6 2006/01/07 01:29:55 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -8,7 +9,7 @@ load('myCredentials.rb')
8
9
  eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true)
9
10
 
10
11
  # Replace ItemID with some item you know exists
11
- resp = eBay.GetItem(:DetailLevel => 'ReturnAll', :ItemID => '4503432058', :IncludeWatchCount => 'true')
12
+ resp = eBay.GetItem(:DetailLevel => 'ReturnAll', :ItemID => '4504390345', :IncludeWatchCount => 'true')
12
13
 
13
14
  puts "AutoPay: " + resp.item.autoPay
14
15
  puts "Country: " + resp.item.country
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: hello_world.rb,v 1.6 2005/12/27 01:13:46 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
 
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ # $Id: revise_item.rb,v 1.2 2006/01/07 07:34:27 garrydolley Exp $
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
5
+ require 'eBayAPI'
6
+
7
+ load('myCredentials.rb')
8
+
9
+ eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true)
10
+
11
+ # I want to revise Item #450439034 -- replace this with an Item # that you know exists and is active
12
+ item = EBay.Item(:ItemID => '4504390345', :Location => 'Brave New World', :Title => 'My new title')
13
+
14
+ resp = eBay.ReviseItem(:DetailLevel => 'ReturnAll', :Item => item,
15
+ :ModifiedFields => [ {:Field => 'Item.Location', :ModifyType => 'Modify'},
16
+ {:Field => 'Item.Title', :ModifyType => 'Modify'} ])
17
+ # Note :Field is case insensitive, so 'item.title' would work also
18
+
19
+ puts "ItemID: " + resp.itemID
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # $Id: verify_add_item.rb,v 1.8 2005/12/27 01:17:01 garrydolley Exp $
2
3
 
3
4
  $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
5
  require 'eBayAPI'
@@ -1,6 +1,5 @@
1
1
  #--
2
- #
3
- # $Id: eBayAPI.rb,v 1.20 2005/12/21 02:02:33 garrydolley Exp $
2
+ # $Id: eBayAPI.rb,v 1.24 2006/01/07 07:53:41 garrydolley Exp $
4
3
  #
5
4
  # Copyright (c) 2005 Garry C. Dolley
6
5
  #
@@ -69,9 +68,14 @@ class API
69
68
  @app_id = app_id
70
69
  @header_handler = RequesterCredentialsHandler.new(auth_token, dev_id, app_id, cert_id)
71
70
 
72
- shost, @site_id = opt[:sandbox] ? ["sandbox.", '0'] : ["", opt[:site_id] ? opt[:site_id] : '1']
71
+ # Default to 'US' (SiteID = 0) site
72
+ @site_id = opt[:site_id] ? opt[:site_id] : '0'
73
+
74
+ shost = opt[:sandbox] ? "sandbox." : ""
73
75
 
74
76
  @endpoint_url = "https://api.#{shost}ebay.com/wsapi"
77
+
78
+ XSD::Charset.encoding = 'UTF8' # Thanks to Ray Hildreth
75
79
  end
76
80
 
77
81
  def method_missing(m, *args) #:nodoc:
@@ -122,6 +126,9 @@ class API
122
126
  service = EBayAPIInterface.new(requestURL())
123
127
  service.headerhandler << @header_handler
124
128
  service.wiredump_dev = STDOUT if @debug
129
+
130
+ # I believe the line below will work after we get the kinks worked out w/ http-access2
131
+ # service.options['protocol.http.ssl_config.verify_mode'] = OpenSSL::SSL::VERIFY_NONE
125
132
 
126
133
  return service
127
134
  end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: ebay
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.1
7
- date: 2005-12-23 00:00:00 -08:00
6
+ version: 0.5.2
7
+ date: 2006-01-07 00:00:00 -08:00
8
8
  summary: "eBay4R is a Ruby wrapper for eBay's Web Services SOAP API. Emphasis is on ease
9
9
  of use and small footprint."
10
10
  require_paths:
@@ -33,10 +33,12 @@ files:
33
33
  - examples/get_account2.rb
34
34
  - examples/get_account3.rb
35
35
  - examples/verify_add_item.rb
36
+ - examples/get_categories2.rb
36
37
  - examples/myCredentials.rb
38
+ - examples/revise_item.rb
37
39
  - examples/hello_world.rb
38
40
  - examples/get_account.rb
39
- - examples/test.rb
41
+ - examples/get_categories.rb
40
42
  - examples/get_item.rb
41
43
  - examples/add_item.rb
42
44
  - examples/get_feedback.rb
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
4
- require 'eBayAPI'
5
-
6
- #
7
- # Example of AddItem call
8
- #
9
-
10
- load('myCredentials.rb')
11
-
12
- eBay = EBay::API.new($authToken, $devId, $appId, $certId, :sandbox => true)
13
-
14
- # New method of generating complex types, needs some more testing...
15
- resp = eBay.AddItem()