awis-sdk-ruby 1.1.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 85946289caa6f5181d1e4d9cf372eee6371df5b4
4
- data.tar.gz: c57c5b1faf09a1937bc5d3a304356f78147a965e
2
+ SHA256:
3
+ metadata.gz: 5c55c0fb766550990c1a7f6f07a64e68a61dbece692b9b6fa540986c247ee91a
4
+ data.tar.gz: a6bde3ae5ae8493d6777a32614b004efc7991115e980aa274ddcaf7fd705dd4a
5
5
  SHA512:
6
- metadata.gz: 199a25e266f137faa7cbb859255891114861289224f8f01d61e64971402dcad84f9252a1c1e31ca35ef0fff8d03ba2d3df6dffb03c72622f6e70859769ada613
7
- data.tar.gz: 765c7bba5f8e2a35b3c00508e87a0c2fb4d28d66e6a3417ee4337c487a454c33abf831c8c8930fcb82c0bbb2c6114fe061379d47c8a2091844b734493db379f3
6
+ metadata.gz: 567fbf489d1ff95d74d4f6802c4c35738513aaa63942076f7c420653292445ae2178d331dcef206b5caf9bb960080e91a0701bb9d02d771f2a640d47063f8ff1
7
+ data.tar.gz: 161b0a7db4c82ee52954319c12693b2e92472ad932e85545c917092e8e29fa75abe32cc9ad9a6f240778d42a8a1b77a42c70cb522b94fd2e2308d91f70799300
@@ -2,7 +2,6 @@ notifications:
2
2
  disabled: true
3
3
  bundler_args: --without extra
4
4
  rvm:
5
- - 1.9.3
6
5
  - 2.0.0
7
6
  - 2.1.1
8
7
  - 2.2.3
data/README.md CHANGED
@@ -1,60 +1,108 @@
1
1
  ## Amazon - Alexa Web Information Service (AWIS)
2
- Ruby Library for AWIS REST API - See: [Alexa Docs](http://docs.amazonwebservices.com/AlexaWebInfoService/latest/)
2
+ Ruby Library for AWIS REST API - see: [Alexa Docs](http://docs.amazonwebservices.com/AlexaWebInfoService/latest/)
3
3
 
4
4
  ### How to installation
5
5
 
6
- ```
6
+ ```ruby
7
7
  gem install awis-sdk-ruby
8
8
  ```
9
9
 
10
+ ### Support Ruby 2.x
11
+
12
+ - The latest update requires Ruby 2.0 or higher
13
+
10
14
  ### How to usage
11
15
 
12
16
  ##### Configure your amazon certificate
13
17
 
14
- ```
18
+ ```ruby
15
19
  require 'awis'
16
20
 
17
21
  AWIS_CONFIG = YAML.load(File.read('awis.yml'))
18
22
  Awis.config do |c|
19
- c.access_key_id = AWIS_CONFIG['access_key_id']
20
- c.secret_access_key = AWIS_CONFIG['secret_access_key']
21
- c.debug = AWIS_CONFIG['debug']
22
- c.protocol = 'https' # Default 'https'
23
- c.timeout = 10 # Default 10
24
- c.open_timeout = 10 # Default 10
25
- c.logger = false # Default nil
23
+ c.access_key_id = AWIS_CONFIG['access_key_id']
24
+ c.secret_access_key = AWIS_CONFIG['secret_access_key']
25
+ c.debug = AWIS_CONFIG['debug']
26
+ c.protocol = 'https' # Default 'https'
27
+ c.timeout = 10 # Default 10
28
+ c.open_timeout = 10 # Default 10
29
+ c.logger = false # Default nil
26
30
  end
27
31
  ```
28
32
 
29
- ##### Get UrlInfo Information
33
+ ##### Get Url Info
30
34
 
31
- ``` ruby
35
+ ```ruby
32
36
  client = Awis::Client.new
33
37
  url_info = client.url_info(url: "site.com")
34
38
  ```
35
39
 
36
40
  If you looking for the API request URI:
37
41
 
38
- * Awis::API::UrlInfo.new.load_request_uri(url: 'site.com')
39
-
42
+ ```ruby
43
+ Awis::API::UrlInfo.new.load_request_uri(url: 'site.com')
44
+ ```
40
45
 
41
- Returns object that contains attributes:
46
+ returns object that contains attributes:
42
47
 
43
48
  * data_url
44
49
  * rank
45
50
  * asin
46
51
  * xml
47
52
 
48
- Returns object that contains relationships:
49
-
50
- * contact_info [:data_url, :owner_name, :email, :physical_address, :company_stock_ticker, :phone_numbers]
51
- * content_data [:data_url, :site_title, :site_description, :speed_median_load_time, :speed_percentile, :adult_content, :language_locale, :links_in_count, :owned_domains]
52
- * usage_statistics [:time_range_months, :time_range_days, :rank_value, :rank_delta, :reach_rank_value, :reach_rank_delta,
53
- :reach_per_million_value, :reach_per_million_delta, :reach_page_views_per_million_value, :reach_page_views_per_million_delta,
54
- :reach_page_views_rank_value, :reach_page_views_rank_delta, :reach_page_views_per_user_value, :reach_page_views_per_user_delta]
55
- - add two methods: [range_type, range_count]
56
- * related_links [:data_url, :navigable_url, :title]
57
- * categories [:title, :absolute_path]
53
+ returns object that contains relationships:
54
+
55
+ **contact_info**
56
+ - attrubutes
57
+ - data_url
58
+ - owner_name
59
+ - email
60
+ - physical_address
61
+ - company_stock_ticker
62
+ - phone_numbers
63
+
64
+ **content_data**
65
+ - attrubutes
66
+ - data_url
67
+ - site_title
68
+ - site_description
69
+ - speed_median_load_time
70
+ - speed_percentile
71
+ - adult_content
72
+ - language_locale
73
+ - links_in_count
74
+ - owned_domains
75
+
76
+ **usage_statistics**
77
+ - attrubutes
78
+ - time_range_months
79
+ - time_range_days
80
+ - rank_value
81
+ - rank_delta
82
+ - reach_rank_value
83
+ - reach_rank_delta,
84
+ - reach_per_million_value
85
+ - reach_per_million_delta
86
+ - page_views_per_million_value
87
+ - page_views_per_million_delta,
88
+ - page_views_rank_value
89
+ - page_views_rank_delta
90
+ - page_views_per_user_value
91
+ - page_views_per_user_delta
92
+ - Methods:
93
+ - range_type
94
+ - range_count
95
+
96
+ **related_links**
97
+ - attrubutes
98
+ - data_url
99
+ - navigable_url
100
+ - title
101
+
102
+ **categories**
103
+ - attrubutes
104
+ - title
105
+ - absolute_path
58
106
 
59
107
  New methods:
60
108
 
@@ -67,14 +115,16 @@ You can specify options:
67
115
 
68
116
  ##### Get Sites Linking In
69
117
 
70
- ``` ruby
118
+ ```ruby
71
119
  client = Awis::Client.new
72
120
  sites_linking_in = client.sites_linking_in(url: "site.com")
73
121
  ```
74
122
 
75
123
  If you looking for the API request URI:
76
124
 
77
- * Awis::API::SitesLinkingIn.new.load_request_uri(url: 'site.com')
125
+ ```ruby
126
+ Awis::API::SitesLinkingIn.new.load_request_uri(url: 'site.com')
127
+ ```
78
128
 
79
129
  Returns object that contains relationships:
80
130
 
@@ -88,14 +138,16 @@ You can specify options:
88
138
 
89
139
  ##### Get Traffic History
90
140
 
91
- ``` ruby
141
+ ```ruby
92
142
  client = Awis::Client.new
93
143
  traffic_history = client.traffic_history(url: "site.com")
94
144
  ```
95
145
 
96
146
  If you looking for the API request URI:
97
147
 
98
- * Awis::API::TrafficHistory.new.load_request_uri(url: 'site.com')
148
+ ```ruby
149
+ Awis::API::TrafficHistory.new.load_request_uri(url: 'site.com')
150
+ ```
99
151
 
100
152
  Returns object that contains methods:
101
153
 
@@ -115,14 +167,16 @@ You can specify options:
115
167
 
116
168
  ##### Get Category Listings
117
169
 
118
- ``` ruby
170
+ ```ruby
119
171
  client = Awis::Client.new
120
172
  category_listings = client.category_listings(path: "Top/Arts")
121
173
  ```
122
174
 
123
175
  If you looking for the API request URI:
124
176
 
125
- * Awis::API::CategoryListings.new.load_request_uri(path: "Top/Games/Card_Games")
177
+ ```ruby
178
+ Awis::API::CategoryListings.new.load_request_uri(path: "Top/Games/Card_Games")
179
+ ```
126
180
 
127
181
  Returns object that contains methods:
128
182
 
@@ -135,14 +189,16 @@ Returns object that contains relationships:
135
189
 
136
190
  ##### Get Category Browse
137
191
 
138
- ``` ruby
192
+ ```ruby
139
193
  client = Awis::Client.new
140
194
  category_browses = client.category_browse(path: "Top/Arts")
141
195
  ```
142
196
 
143
197
  If you looking for the API request URI:
144
198
 
145
- * Awis::API::CategoryBrowse.new.load_request_uri(path: "Top/Games/Card_Games")
199
+ ```ruby
200
+ Awis::API::CategoryBrowse.new.load_request_uri(path: "Top/Games/Card_Games")
201
+ ```
146
202
 
147
203
  Returns object that contains methods:
148
204
 
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'awis/version'
3
+ require_relative "./lib/awis/version"
6
4
 
7
5
  Gem::Specification.new do |spec|
8
6
  spec.name = 'awis-sdk-ruby'
@@ -4,15 +4,15 @@ require 'multi_xml'
4
4
  require 'nokogiri'
5
5
  require 'aws-sigv4'
6
6
 
7
- require 'awis/version'
8
- require 'awis/hash'
9
- require 'awis/utils'
10
- require 'awis/exceptions'
11
- require 'awis/connection'
12
- require 'awis/config'
13
- require 'awis/client'
14
- require 'awis/api'
15
- require 'awis/models'
7
+ require_relative './awis/version'
8
+ require_relative './awis/hash'
9
+ require_relative './awis/utils'
10
+ require_relative './awis/exceptions'
11
+ require_relative './awis/connection'
12
+ require_relative './awis/config'
13
+ require_relative './awis/client'
14
+ require_relative './awis/api'
15
+ require_relative './awis/models'
16
16
 
17
17
  module Awis
18
18
  SERVICE_PATH = 'api'
@@ -1,5 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative './api/base'
4
+ require_relative './api/url_info'
5
+ require_relative './api/traffic_history'
6
+ require_relative './api/sites_linking_in'
7
+ require_relative './api/category_listings'
8
+ require_relative './api/category_browse'
9
+
3
10
  module Awis
4
11
  module API
5
12
  autoload :Base, 'awis/api/base'
@@ -1,5 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative './models/base'
4
+ require_relative './models/base_entity'
5
+ require_relative './models/url_info'
6
+ require_relative './models/traffic_history'
7
+ require_relative './models/sites_linking_in'
8
+ require_relative './models/category_listings'
9
+ require_relative './models/category_browse'
10
+
3
11
  module Awis
4
12
  module Models
5
13
  autoload :Base, 'awis/models/base'
@@ -371,7 +371,7 @@ module Awis
371
371
  :page_views_per_user_value, :page_views_per_user_delta
372
372
 
373
373
  def range_type
374
- return 'month' unless time_range_months.nil? || time_range_months.empty?
374
+ return 'month' unless time_range_months.nil?
375
375
 
376
376
  'day'
377
377
  end
@@ -1,7 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'awis/utils/extra'
4
- require 'awis/utils/variable'
3
+ require_relative './utils/extra'
4
+ require_relative './utils/variable'
5
+ require_relative './utils/xml'
5
6
 
6
7
  module Awis
7
8
  module Utils
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Awis
4
- VERSION = '1.1.2'
4
+ VERSION = '2.0.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awis-sdk-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Encore Shao
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-09 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sigv4
@@ -168,7 +168,7 @@ files:
168
168
  homepage: https://github.com/encoreshao/amazon-awis
169
169
  licenses: []
170
170
  metadata: {}
171
- post_install_message:
171
+ post_install_message:
172
172
  rdoc_options: []
173
173
  require_paths:
174
174
  - lib
@@ -183,9 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
- rubyforge_project:
187
- rubygems_version: 2.6.13
188
- signing_key:
186
+ rubygems_version: 3.0.3
187
+ signing_key:
189
188
  specification_version: 4
190
189
  summary: Ruby - Amazon Alexa Web Information Service Library (AWIS)
191
190
  test_files: []