sevennet-api 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/sevennet/api.rb +1 -1
- data/lib/sevennet/api/version.rb +1 -1
- data/sevennet-api.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16c70b05ee92b98d076c68fbd6e40f2962c1c845
|
4
|
+
data.tar.gz: 83135371d3f1f2d74ad46df70c046c59e20de27c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 753493706edb51440706b07c6b9d11ccc02f686b672f732ca96d27a17ad89eef14f7d10606beb5b0883d782c07c2f7dc6e81a7adc6280fa7925b04d636b05b5a
|
7
|
+
data.tar.gz: dba8b9dc35f25c7d2fef4f364eb499758c3ee4cf83b43edacbbb79ae29fa59de8600bddf5106ddbd83843cec059f21e0474f42d342bafa65e045a330bb03fc87
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Sevennet::Api
|
2
|
-
|
3
|
-
|
2
|
+
[](http://badge.fury.io/rb/sevennet-api)
|
3
|
+
Ruby 7netshopping API using Nokogiri. Uses Response and Element wrapper classes for easy access to the REST API XML output.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,6 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
require 'sevennet/api'
|
22
22
|
|
23
|
+
|
23
24
|
Sevennet::Api.configure do |options|
|
24
25
|
options[:ApiUserId] = 'your api user id'
|
25
26
|
options[:APISecretKey] = 'your api secret key'
|
@@ -29,7 +30,7 @@ Or install it yourself as:
|
|
29
30
|
res = Sevennet::Api.get_shopping_category('') # root category
|
30
31
|
res = Sevennet::Api.get_shopping_category('books') # books category
|
31
32
|
res.categories.each do |category|
|
32
|
-
children = category.
|
33
|
+
children = category.get_elements('ChildCategory')
|
33
34
|
children.each do |child|
|
34
35
|
code = child.get('CategoryCode')
|
35
36
|
...
|
@@ -64,7 +65,8 @@ Or install it yourself as:
|
|
64
65
|
res = Sevennet::Api.get_spc_category('') # root category
|
65
66
|
res = Sevennet::Api.get_spc_category('home') # home category
|
66
67
|
res.categories.each do |category|
|
67
|
-
children = category.
|
68
|
+
children = category.get_elements('ChildCategory')
|
69
|
+
next if children.nil?
|
68
70
|
children.each do |child|
|
69
71
|
code = child.get('CategoryCode')
|
70
72
|
...
|
data/lib/sevennet/api.rb
CHANGED
@@ -123,7 +123,7 @@ module Sevennet
|
|
123
123
|
opts = self.options.merge(opts) if self.options
|
124
124
|
|
125
125
|
# Include other required options
|
126
|
-
opts[:Timestamp] = Time.now.strftime('%Y-%m-%dT%XZ')
|
126
|
+
opts[:Timestamp] = Time.now.utc.strftime('%Y-%m-%dT%XZ')
|
127
127
|
|
128
128
|
request_url = prepare_url(opts)
|
129
129
|
|
data/lib/sevennet/api/version.rb
CHANGED
data/sevennet-api.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Sevennet::Api::VERSION
|
9
9
|
spec.authors = ["shoprev"]
|
10
10
|
spec.email = ["admin@shoprev.net"]
|
11
|
-
spec.description = %q{
|
12
|
-
spec.summary = %q{
|
11
|
+
spec.description = %q{Ruby 7netshopping API using Nokogiri.}
|
12
|
+
spec.summary = %q{Ruby 7netshopping API using Nokogiri.}
|
13
13
|
spec.homepage = "https://github.com/shoprev/sevennet-api"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sevennet-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shoprev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description: Ruby 7netshopping API using Nokogiri.
|
84
84
|
email:
|
85
85
|
- admin@shoprev.net
|
86
86
|
executables: []
|
@@ -120,7 +120,7 @@ rubyforge_project:
|
|
120
120
|
rubygems_version: 2.0.3
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
|
-
summary:
|
123
|
+
summary: Ruby 7netshopping API using Nokogiri.
|
124
124
|
test_files:
|
125
125
|
- spec/sevennet/api_spec.rb
|
126
126
|
- spec/spec_helper.rb
|