awis-sdk-ruby 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/awis/api/base.rb +4 -0
- data/lib/awis/api/category_browse.rb +1 -5
- data/lib/awis/api/category_listings.rb +7 -7
- data/lib/awis/api/sites_linking_in.rb +6 -2
- data/lib/awis/api/traffic_history.rb +10 -4
- data/lib/awis/models/url_info.rb +6 -3
- data/lib/awis/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
data/lib/awis/api/base.rb
CHANGED
@@ -28,17 +28,13 @@ module Awis
|
|
28
28
|
"Action" => action_name,
|
29
29
|
"ResponseGroup" => response_groups,
|
30
30
|
"Path" => arguments[:path],
|
31
|
-
"Descriptions" =>
|
31
|
+
"Descriptions" => request_description_params
|
32
32
|
}
|
33
33
|
end
|
34
34
|
|
35
35
|
def response_groups
|
36
36
|
arguments[:response_group].sort.map { |group| camelize(group) }.join(",")
|
37
37
|
end
|
38
|
-
|
39
|
-
def descriptions_params
|
40
|
-
arguments[:descriptions].to_s.capitalize
|
41
|
-
end
|
42
38
|
end
|
43
39
|
end
|
44
40
|
end
|
@@ -28,11 +28,11 @@ module Awis
|
|
28
28
|
|
29
29
|
def params
|
30
30
|
{
|
31
|
-
"Action" =>
|
32
|
-
"ResponseGroup" =>
|
31
|
+
"Action" => action_name,
|
32
|
+
"ResponseGroup" => response_groups,
|
33
33
|
"Path" => arguments[:path],
|
34
34
|
"Recursive" => recursive_param,
|
35
|
-
"Descriptions" =>
|
35
|
+
"Descriptions" => request_description_params,
|
36
36
|
"SortBy" => sort_by_param,
|
37
37
|
"Count" => arguments[:count],
|
38
38
|
"Start" => arguments[:start],
|
@@ -43,13 +43,13 @@ module Awis
|
|
43
43
|
arguments[:recursive].to_s.capitalize
|
44
44
|
end
|
45
45
|
|
46
|
-
def descriptions_params
|
47
|
-
arguments[:descriptions].to_s.capitalize
|
48
|
-
end
|
49
|
-
|
50
46
|
def sort_by_param
|
51
47
|
camelize(arguments[:sort_by])
|
52
48
|
end
|
49
|
+
|
50
|
+
def response_groups
|
51
|
+
DEFAULT_RESPONSE_GROUP.map { |group| camelize(group) }.join(",")
|
52
|
+
end
|
53
53
|
end
|
54
54
|
end
|
55
55
|
end
|
@@ -20,13 +20,17 @@ module Awis
|
|
20
20
|
|
21
21
|
def params
|
22
22
|
{
|
23
|
-
"Action" =>
|
23
|
+
"Action" => action_name,
|
24
24
|
"Url" => arguments[:url],
|
25
|
-
"ResponseGroup" =>
|
25
|
+
"ResponseGroup" => response_groups,
|
26
26
|
"Count" => arguments[:count],
|
27
27
|
"Start" => arguments[:start]
|
28
28
|
}
|
29
29
|
end
|
30
|
+
|
31
|
+
def response_groups
|
32
|
+
DEFAULT_RESPONSE_GROUP.map { |group| camelize(group) }.join(",")
|
33
|
+
end
|
30
34
|
end
|
31
35
|
end
|
32
36
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
module Awis
|
2
2
|
module API
|
3
3
|
class TrafficHistory < Base
|
4
|
+
DEFAULT_RESPONSE_GROUP = %w(history).freeze
|
5
|
+
|
4
6
|
def load_request_uri(arguments = {})
|
5
7
|
validation_arguments!(arguments)
|
6
8
|
|
@@ -10,11 +12,11 @@ module Awis
|
|
10
12
|
private
|
11
13
|
def params
|
12
14
|
{
|
13
|
-
"Action" =>
|
15
|
+
"Action" => action_name,
|
14
16
|
"Url" => arguments[:url],
|
15
|
-
"ResponseGroup" =>
|
17
|
+
"ResponseGroup" => response_groups,
|
16
18
|
"Range" => arguments[:range],
|
17
|
-
"Start" =>
|
19
|
+
"Start" => start_date,
|
18
20
|
}
|
19
21
|
end
|
20
22
|
|
@@ -26,9 +28,13 @@ module Awis
|
|
26
28
|
@arguments[:start] = arguments.fetch(:start) { Time.now - (3600 * 24 * @arguments[:range].to_i) }
|
27
29
|
end
|
28
30
|
|
29
|
-
def
|
31
|
+
def start_date
|
30
32
|
arguments[:start].respond_to?(:strftime) ? arguments[:start].strftime("%Y%m%d") : arguments[:start]
|
31
33
|
end
|
34
|
+
|
35
|
+
def response_groups
|
36
|
+
DEFAULT_RESPONSE_GROUP.map { |group| camelize(group) }.join(",")
|
37
|
+
end
|
32
38
|
end
|
33
39
|
end
|
34
40
|
end
|
data/lib/awis/models/url_info.rb
CHANGED
@@ -207,9 +207,12 @@ module Awis
|
|
207
207
|
end
|
208
208
|
|
209
209
|
class UsageStatistic < BaseEntity
|
210
|
-
attr_accessor :time_range_months, :time_range_days, :rank_value, :rank_delta,
|
211
|
-
:
|
212
|
-
:
|
210
|
+
attr_accessor :time_range_months, :time_range_days, :rank_value, :rank_delta,
|
211
|
+
:reach_rank_value, :reach_rank_delta,
|
212
|
+
:reach_per_million_value, :reach_per_million_delta,
|
213
|
+
:reach_page_views_per_million_value, :reach_page_views_per_million_delta,
|
214
|
+
:reach_page_views_rank_value, :reach_page_views_rank_delta,
|
215
|
+
:reach_page_views_per_user_value, :reach_page_views_per_user_delta
|
213
216
|
|
214
217
|
def range_type
|
215
218
|
return 'month' unless time_range_months.blank?
|
data/lib/awis/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awis-sdk-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
segments:
|
169
169
|
- 0
|
170
|
-
hash:
|
170
|
+
hash: 4148590925117238172
|
171
171
|
requirements: []
|
172
172
|
rubyforge_project:
|
173
173
|
rubygems_version: 1.8.23
|