yt 0.22.1 → 0.22.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/yt/associations/has_reports.rb +76 -26
- data/lib/yt/collections/reports.rb +10 -7
- data/lib/yt/models/channel.rb +19 -16
- data/lib/yt/models/playlist.rb +4 -4
- data/lib/yt/models/video.rb +19 -16
- data/lib/yt/version.rb +1 -1
- data/spec/collections/reports_spec.rb +1 -1
- data/spec/requests/as_content_owner/channel_spec.rb +364 -20
- data/spec/requests/as_content_owner/playlist_spec.rb +228 -6
- data/spec/requests/as_content_owner/video_spec.rb +522 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e80b3bef680e2c1352adc07802719b9721cb49b
|
4
|
+
data.tar.gz: 794761dff30b57acb13261d180e68c61a52792e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5b1dc5b9561f1f3645f762ae0a532f38606f6fcff7d989465a6f0eef11a253ad268f573285b5491f45d84de67309f081ca393fc55b24b67549a9913624521ee
|
7
|
+
data.tar.gz: 26d7305449a311a6ca0e04b62d33be2c6d114879dab273b995db20e34d1e52c1621f2d255b6d495f4d94c7e32d406a0dc7fc3a32f229b437f1f2f2eb36418403
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
+
## 0.22.2 - 2015-05-15
|
10
|
+
|
11
|
+
* [FEATURE] New `by: :search_term` option for reports.
|
12
|
+
* [FEATURE] New `in: {state: 'XX'}` option to limit reports to a US state
|
13
|
+
* [FEATURE] New `uniques by: :day` report
|
14
|
+
|
9
15
|
## 0.22.1 - 2015-05-13
|
10
16
|
|
11
17
|
* [FEATURE] New `by: :country` option for channel, video and playlist reports
|
data/README.md
CHANGED
@@ -41,7 +41,7 @@ To install on your system, run
|
|
41
41
|
|
42
42
|
To use inside a bundled Ruby project, add this line to the Gemfile:
|
43
43
|
|
44
|
-
gem 'yt', '~> 0.22.
|
44
|
+
gem 'yt', '~> 0.22.2'
|
45
45
|
|
46
46
|
Since the gem follows [Semantic Versioning](http://semver.org),
|
47
47
|
indicating the full version in your Gemfile (~> *major*.*minor*.*patch*)
|
@@ -17,84 +17,129 @@ module Yt
|
|
17
17
|
# for each day in the time-range.
|
18
18
|
# @example Get the $1 for each day of last week:
|
19
19
|
# resource.$1 since: 2.weeks.ago, until: 1.week.ago, by: :day
|
20
|
-
# # => {Wed, 8 May 2014 => 12.0, Thu, 9 May 2014 => 34.
|
20
|
+
# # => {Wed, 8 May 2014 => 12.0, Thu, 9 May 2014 => 34.0, …}
|
21
|
+
# @macro report
|
22
|
+
|
23
|
+
# @!macro [new] report_with_range
|
21
24
|
# @return [Hash<Symbol, $2>] if grouped by range, the $1
|
22
25
|
# for the entire time-range (under the key +:total+).
|
23
26
|
# @example Get the $1 for the whole last week:
|
24
27
|
# resource.$1 since: 2.weeks.ago, until: 1.week.ago, by: :range
|
25
28
|
# # => {total: 564.0}
|
26
|
-
|
29
|
+
|
30
|
+
# @!macro [new] report_with_country
|
31
|
+
# @option options [<String, Hash>] :in The country to limit the $1
|
32
|
+
# to. Can either be the two-letter ISO-3166-1 code of a country, such
|
33
|
+
# as +"US"+, or a Hash with the code in the +:country+ key, such
|
34
|
+
# as +{country: "US"}+.
|
35
|
+
# @example Get the $1 for the whole last week in France only:
|
36
|
+
# resource.$1 since: 2.weeks.ago, until: 1.week.ago, by: :range, in: 'FR'
|
37
|
+
# # => {total: 44.0}
|
38
|
+
|
39
|
+
# @!macro [new] report_with_country_and_state
|
40
|
+
# @option options [<String, Hash>] :in The location to limit the $1
|
41
|
+
# to. Can either be the two-letter ISO-3166-1 code of a country, such
|
42
|
+
# as +"US"+, or a Hash that either contains the +:country+ key, such
|
43
|
+
# as +{country: "US"}+ or the +:state+ key, such as +{state: "TX"}+.
|
44
|
+
# Note that YouTube API only provides data for US states.
|
45
|
+
# @example Get the $1 for the whole last week in Texas only:
|
46
|
+
# resource.$1 since: 2.weeks.ago, until: 1.week.ago, by: :range, in: {state: 'TX'}
|
47
|
+
# # => {total: 19.0}
|
27
48
|
|
28
49
|
# @!macro [new] report_by_day
|
29
50
|
# @option options [Symbol] :by (:day) The dimension to collect $1 by.
|
30
51
|
# Accepted values are: +:day+.
|
31
52
|
# @macro report_with_day
|
32
53
|
|
54
|
+
# @!macro [new] report_by_day_and_country
|
55
|
+
# @option options [Symbol] :by (:day) The dimension to collect $1 by.
|
56
|
+
# Accepted values are: +:day+, :+range+.
|
57
|
+
# @macro report_with_day
|
58
|
+
# @macro report_with_range
|
59
|
+
# @macro report_with_country
|
60
|
+
|
61
|
+
# @!macro [new] report_by_day_and_state
|
62
|
+
# @option options [Symbol] :by (:day) The dimension to collect $1 by.
|
63
|
+
# Accepted values are: +:day+, :+range+.
|
64
|
+
# @macro report_with_day
|
65
|
+
# @macro report_with_range
|
66
|
+
# @macro report_with_country_and_state
|
67
|
+
|
33
68
|
# @!macro [new] report_with_video_dimensions
|
34
69
|
# @return [Hash<Symbol, $2>] if grouped by playback location, the
|
35
70
|
# $1 for each traffic playback location.
|
36
71
|
# @example Get yesterday’s $1 grouped by playback location:
|
37
|
-
# resource.$1
|
72
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :playback_location
|
38
73
|
# # => {embedded: 53.0, watch: 467.0, …}
|
39
74
|
# @return [Hash<Yt::Video, $2>] if grouped by related video, the
|
40
75
|
# $1 for each related video.
|
41
76
|
# @example Get yesterday’s $1 by related video:
|
42
|
-
# resource.$1
|
77
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :related_video
|
43
78
|
# # => {#<Yt::Video @id=…> => 33.0, #<Yt::Video @id=…> => 12.0, …}
|
44
79
|
# @return [Hash<Yt::Video, $2>] if grouped by device type, the
|
45
80
|
# $1 for each device type.
|
81
|
+
# @example Get yesterday’s $1 by search term:
|
82
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :search_term
|
83
|
+
# # => {"fullscreen" => 33.0, "good music" => 12.0, …}
|
84
|
+
# @return [Hash<String, $2>] if grouped by search term, the
|
85
|
+
# $1 for each search term that led viewers to the content.
|
46
86
|
# @example Get yesterday’s $1 by device type:
|
47
|
-
# resource.$1
|
87
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :device_type
|
48
88
|
# # => {mobile: 133.0, tv: 412.0, …}
|
49
89
|
# @return [Hash<Yt::Video, $2>] if grouped by traffic source, the
|
50
90
|
# $1 for each traffic source.
|
51
91
|
# @example Get yesterday’s $1 by traffic source:
|
52
|
-
# resource.$1
|
92
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :traffic_source
|
53
93
|
# # => {advertising: 543.0, playlist: 92.0, …}
|
54
94
|
# @macro report_with_day
|
95
|
+
# @macro report_with_range
|
55
96
|
|
56
97
|
# @!macro [new] report_by_video_dimensions
|
57
98
|
# @option options [Symbol] :by (:day) The dimension to collect $1 by.
|
58
|
-
# Accepted values are: +:day+, +:traffic_source+,
|
59
|
-
# +:playback_location+, +:related_video+,
|
99
|
+
# Accepted values are: +:day+, +:range+, +:traffic_source+,
|
100
|
+
# +:search_term+, +:playback_location+, +:related_video+,
|
101
|
+
# +:embedded_player_location+.
|
60
102
|
# @return [Hash<Symbol, $2>] if grouped by embedded player location,
|
61
103
|
# the $1 for each embedded player location.
|
62
104
|
# @example Get yesterday’s $1 by embedded player location:
|
63
|
-
# resource.$1
|
105
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :embedded_player_location
|
64
106
|
# # => {"fullscreen.net" => 92.0, "yahoo.com" => 14.0, …}
|
65
107
|
# @macro report_with_video_dimensions
|
108
|
+
# @macro report_with_country_and_state
|
66
109
|
|
67
110
|
# @!macro [new] report_with_channel_dimensions
|
68
111
|
# @return [Hash<Yt::Video, $2>] if grouped by video, the
|
69
112
|
# $1 for each video.
|
70
113
|
# @example Get yesterday’s $1 by video:
|
71
|
-
# resource.$1
|
114
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :video
|
72
115
|
# # => {#<Yt::Video @id=…> => 33.0, #<Yt::Video @id=…> => 12.0, …}
|
73
116
|
# @return [Hash<Yt::Video, $2>] if grouped by playlist, the
|
74
117
|
# $1 for each playlist.
|
75
118
|
# @example Get yesterday’s $1 by playlist:
|
76
|
-
# resource.$1
|
119
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :playlist
|
77
120
|
# # => {#<Yt::Video @id=…> => 33.0, #<Yt::Video @id=…> => 12.0, …}
|
78
121
|
# @macro report_with_video_dimensions
|
79
122
|
|
80
123
|
# @!macro [new] report_by_channel_dimensions
|
81
124
|
# @option options [Symbol] :by (:day) The dimension to collect $1 by.
|
82
|
-
# Accepted values are: +:day+, +:traffic_source+,
|
83
|
-
# +:playback_location+, +:related_video+, +:video+,
|
125
|
+
# Accepted values are: +:day+, +:range+, +:traffic_source+,
|
126
|
+
# +:search_term+, +:playback_location+, +:related_video+, +:video+,
|
84
127
|
# +:playlist+, +:embedded_player_location+.
|
85
128
|
# @return [Hash<Symbol, $2>] if grouped by embedded player location,
|
86
129
|
# the $1 for each embedded player location.
|
87
130
|
# @example Get yesterday’s $1 by embedded player location:
|
88
|
-
# resource.$1
|
131
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :embedded_player_location
|
89
132
|
# # => {"fullscreen.net" => 92.0, "yahoo.com" => 14.0, …}
|
90
133
|
# @macro report_with_channel_dimensions
|
134
|
+
# @macro report_with_country_and_state
|
91
135
|
|
92
136
|
# @!macro [new] report_by_playlist_dimensions
|
93
137
|
# @option options [Symbol] :by (:day) The dimension to collect $1 by.
|
94
|
-
# Accepted values are: +:day+, +:traffic_source+,
|
138
|
+
# Accepted values are: +:day+, +:range+, +:traffic_source+,
|
95
139
|
# +:playback_location+, +:related_video+, +:video+,
|
96
140
|
# +:playlist+.
|
97
141
|
# @macro report_with_channel_dimensions
|
142
|
+
# @macro report_with_country_and_state
|
98
143
|
|
99
144
|
# @!macro [new] report_by_gender_and_age_group
|
100
145
|
# @option options [Symbol] :by (:gender_age_group) The dimension to
|
@@ -103,19 +148,23 @@ module Yt
|
|
103
148
|
# @return [Hash<Symbol, $2>] if grouped by gender, the
|
104
149
|
# viewer percentage by gender.
|
105
150
|
# @example Get yesterday’s viewer percentage by gender:
|
106
|
-
# resource.$1
|
151
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :gender
|
107
152
|
# # => {female: 53.0, male: 47.0}
|
108
153
|
# @return [Hash<String, $2>] if grouped by age group, the
|
109
154
|
# viewer percentage by age group.
|
110
155
|
# @example Get yesterday’s $1 grouped by age group:
|
111
|
-
# resource.$1
|
156
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, by: :age_group
|
112
157
|
# # => {"18-24" => 4.54, "35-24" => 12.31, "45-34" => 8.92, …}
|
113
158
|
# @return [Hash<Symbol, [Hash<String, $2>]>] if grouped by gender
|
114
159
|
# and age group, the viewer percentage by gender/age group.
|
115
160
|
# @example Get yesterday’s $1 by gender and age group:
|
116
|
-
# resource.$1
|
161
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago
|
117
162
|
# # => {female: {"18-24" => 12.12, "25-34" => 16.16, …}, male:…}
|
163
|
+
# @example Get yesterday’s $1 by gender and age group in France only:
|
164
|
+
# resource.$1 since: 1.day.ago, until: 1.day.ago, in: 'FR'
|
165
|
+
# # => {female: {"18-24" => 16.12, "25-34" => 13.16, …}, male:…}
|
118
166
|
# @macro report
|
167
|
+
# @macro report_with_country_and_state
|
119
168
|
|
120
169
|
# Defines two public instance methods to access the reports of a
|
121
170
|
# resource for a specific metric.
|
@@ -148,29 +197,30 @@ module Yt
|
|
148
197
|
to = options[:until] || options[:to] || (metric == :viewer_percentage ? Date.today : 1.day.ago)
|
149
198
|
location = options[:in]
|
150
199
|
country = location.is_a?(Hash) ? location[:country] : location
|
200
|
+
state = location[:state] if location.is_a?(Hash)
|
151
201
|
|
152
202
|
range = Range.new *[from, to].map(&:to_date)
|
153
203
|
dimension = options[:by] || (metric == :viewer_percentage ? :gender_age_group : :day)
|
154
204
|
|
155
|
-
ivar = instance_variable_get "@#{metric}_#{dimension}_#{country}"
|
156
|
-
instance_variable_set "@#{metric}_#{dimension}_#{country}", ivar || {}
|
205
|
+
ivar = instance_variable_get "@#{metric}_#{dimension}_#{country}_#{state}"
|
206
|
+
instance_variable_set "@#{metric}_#{dimension}_#{country}_#{state}", ivar || {}
|
157
207
|
|
158
208
|
case dimension
|
159
209
|
when :day
|
160
210
|
Hash[*range.flat_map do |date|
|
161
|
-
[date, instance_variable_get("@#{metric}_#{dimension}_#{country}")[date] ||= send("range_#{metric}", range, dimension, country)[date]]
|
211
|
+
[date, instance_variable_get("@#{metric}_#{dimension}_#{country}_#{state}")[date] ||= send("range_#{metric}", range, dimension, country, state)[date]]
|
162
212
|
end]
|
163
213
|
else
|
164
|
-
instance_variable_get("@#{metric}_#{dimension}_#{country}")[range] ||= send("range_#{metric}", range, dimension, country)
|
214
|
+
instance_variable_get("@#{metric}_#{dimension}_#{country}_#{state}")[range] ||= send("range_#{metric}", range, dimension, country, state)
|
165
215
|
end
|
166
216
|
end
|
167
217
|
end
|
168
218
|
|
169
219
|
def define_range_metric_method(metric, type)
|
170
|
-
define_method "range_#{metric}" do |date_range, dimension, country|
|
171
|
-
ivar = instance_variable_get "@range_#{metric}_#{dimension}_#{country}"
|
172
|
-
instance_variable_set "@range_#{metric}_#{dimension}_#{country}", ivar || {}
|
173
|
-
instance_variable_get("@range_#{metric}_#{dimension}_#{country}")[date_range] ||= send("all_#{metric}").within date_range, country, dimension, type
|
220
|
+
define_method "range_#{metric}" do |date_range, dimension, country, state|
|
221
|
+
ivar = instance_variable_get "@range_#{metric}_#{dimension}_#{country}_#{state}"
|
222
|
+
instance_variable_set "@range_#{metric}_#{dimension}_#{country}_#{state}", ivar || {}
|
223
|
+
instance_variable_get("@range_#{metric}_#{dimension}_#{country}_#{state}")[date_range] ||= send("all_#{metric}").within date_range, country, state, dimension, type
|
174
224
|
end
|
175
225
|
private "range_#{metric}"
|
176
226
|
end
|
@@ -10,6 +10,7 @@ module Yt
|
|
10
10
|
hash[:playback_location] = {name: 'insightPlaybackLocationType', parse: ->(location, value) {[PLAYBACK_LOCATIONS.key(location), value]} }
|
11
11
|
hash[:embedded_player_location] = {name: 'insightPlaybackLocationDetail', parse: ->(url, value) {[url, value]} }
|
12
12
|
hash[:related_video] = {name: 'insightTrafficSourceDetail', parse: ->(video_id, value) { [Yt::Video.new(id: video_id, auth: @auth), value] } }
|
13
|
+
hash[:search_term] = {name: 'insightTrafficSourceDetail', parse: ->(search_term, value) { [search_term, value] } }
|
13
14
|
hash[:video] = {name: 'video', parse: ->(video_id, value) { [Yt::Video.new(id: video_id, auth: @auth), value] } }
|
14
15
|
hash[:playlist] = {name: 'playlist', parse: ->(playlist_id, value) { [Yt::Playlist.new(id: playlist_id, auth: @auth), value] } }
|
15
16
|
hash[:device_type] = {name: 'deviceType', parse: ->(type, value) { [type.downcase.to_sym, value] } }
|
@@ -50,10 +51,11 @@ module Yt
|
|
50
51
|
|
51
52
|
attr_writer :metric
|
52
53
|
|
53
|
-
def within(days_range, country, dimension, type, try_again = true)
|
54
|
+
def within(days_range, country, state, dimension, type, try_again = true)
|
54
55
|
@days_range = days_range
|
55
56
|
@dimension = dimension
|
56
57
|
@country = country
|
58
|
+
@state = state
|
57
59
|
if dimension == :gender_age_group # array of array
|
58
60
|
Hash.new{|h,k| h[k] = Hash.new 0.0}.tap do |hash|
|
59
61
|
each{|gender, age_group, value| hash[gender][age_group[3..-1]] = value}
|
@@ -68,7 +70,7 @@ module Yt
|
|
68
70
|
# same query is a workaround that works and can hardly cause any damage.
|
69
71
|
# Similarly, once in while YouTube responds with a random 503 error.
|
70
72
|
rescue Yt::Error => e
|
71
|
-
try_again && rescue?(e) ? sleep(3) && within(days_range, dimension, type, false) : raise
|
73
|
+
try_again && rescue?(e) ? sleep(3) && within(days_range, country, state, dimension, type, false) : raise
|
72
74
|
end
|
73
75
|
|
74
76
|
private
|
@@ -101,14 +103,15 @@ module Yt
|
|
101
103
|
params['dimensions'] = DIMENSIONS[@dimension][:name] unless @dimension == :range
|
102
104
|
params['max-results'] = 10 if @dimension == :video
|
103
105
|
params['max-results'] = 200 if @dimension == :playlist
|
104
|
-
params['max-results'] = 25 if @dimension
|
105
|
-
params['
|
106
|
-
params[
|
107
|
-
params[:filters] = ((params[:filters] || '').split(';') + ["country
|
108
|
-
params[:filters] = ((params[:filters] || '').split(';') + ["
|
106
|
+
params['max-results'] = 25 if @dimension.in? [:embedded_player_location, :related_video, :search_term]
|
107
|
+
params['sort'] = "-#{@metric.to_s.camelize(:lower)}" if @dimension.in? [:video, :playlist, :embedded_player_location, :related_video, :search_term]
|
108
|
+
params[:filters] = ((params[:filters] || '').split(';') + ["country==US"]).compact.uniq.join(';') if @dimension == :state && !@state
|
109
|
+
params[:filters] = ((params[:filters] || '').split(';') + ["country==#{@country}"]).compact.uniq.join(';') if @country && !@state
|
110
|
+
params[:filters] = ((params[:filters] || '').split(';') + ["province==US-#{@state}"]).compact.uniq.join(';') if @state
|
109
111
|
params[:filters] = ((params[:filters] || '').split(';') + ['isCurated==1']).compact.uniq.join(';') if @dimension == :playlist
|
110
112
|
params[:filters] = ((params[:filters] || '').split(';') + ['insightPlaybackLocationType==EMBEDDED']).compact.uniq.join(';') if @dimension == :embedded_player_location
|
111
113
|
params[:filters] = ((params[:filters] || '').split(';') + ['insightTrafficSourceType==RELATED_VIDEO']).compact.uniq.join(';') if @dimension == :related_video
|
114
|
+
params[:filters] = ((params[:filters] || '').split(';') + ['insightTrafficSourceType==YT_SEARCH']).compact.uniq.join(';') if @dimension == :search_term
|
112
115
|
end
|
113
116
|
end
|
114
117
|
|
data/lib/yt/models/channel.rb
CHANGED
@@ -106,58 +106,61 @@ module Yt
|
|
106
106
|
# @macro report_by_channel_dimensions
|
107
107
|
has_report :views, Integer
|
108
108
|
|
109
|
+
# @macro report_by_day
|
110
|
+
has_report :uniques, Integer
|
111
|
+
|
109
112
|
# @macro report_by_channel_dimensions
|
110
113
|
has_report :estimated_minutes_watched, Float
|
111
114
|
|
112
115
|
# @macro report_by_gender_and_age_group
|
113
116
|
has_report :viewer_percentage, Float
|
114
117
|
|
115
|
-
# @macro
|
118
|
+
# @macro report_by_day_and_country
|
116
119
|
has_report :comments, Integer
|
117
120
|
|
118
|
-
# @macro
|
121
|
+
# @macro report_by_day_and_country
|
119
122
|
has_report :likes, Integer
|
120
123
|
|
121
|
-
# @macro
|
124
|
+
# @macro report_by_day_and_country
|
122
125
|
has_report :dislikes, Integer
|
123
126
|
|
124
|
-
# @macro
|
127
|
+
# @macro report_by_day_and_country
|
125
128
|
has_report :shares, Integer
|
126
129
|
|
127
|
-
# @macro
|
130
|
+
# @macro report_by_day_and_country
|
128
131
|
has_report :subscribers_gained, Integer
|
129
132
|
|
130
|
-
# @macro
|
133
|
+
# @macro report_by_day_and_country
|
131
134
|
has_report :subscribers_lost, Integer
|
132
135
|
|
133
|
-
# @macro
|
136
|
+
# @macro report_by_day_and_country
|
134
137
|
has_report :favorites_added, Integer
|
135
138
|
|
136
|
-
# @macro
|
139
|
+
# @macro report_by_day_and_country
|
137
140
|
has_report :favorites_removed, Integer
|
138
141
|
|
139
|
-
# @macro
|
142
|
+
# @macro report_by_day_and_state
|
140
143
|
has_report :average_view_duration, Float
|
141
144
|
|
142
|
-
# @macro
|
145
|
+
# @macro report_by_day_and_state
|
143
146
|
has_report :average_view_percentage, Float
|
144
147
|
|
145
|
-
# @macro
|
148
|
+
# @macro report_by_day_and_state
|
146
149
|
has_report :annotation_clicks, Integer
|
147
150
|
|
148
|
-
# @macro
|
151
|
+
# @macro report_by_day_and_state
|
149
152
|
has_report :annotation_click_through_rate, Float
|
150
153
|
|
151
|
-
# @macro
|
154
|
+
# @macro report_by_day_and_state
|
152
155
|
has_report :annotation_close_rate, Float
|
153
156
|
|
154
|
-
# @macro
|
157
|
+
# @macro report_by_day_and_country
|
155
158
|
has_report :earnings, Float
|
156
159
|
|
157
|
-
# @macro
|
160
|
+
# @macro report_by_day_and_country
|
158
161
|
has_report :impressions, Integer
|
159
162
|
|
160
|
-
# @macro
|
163
|
+
# @macro report_by_day_and_country
|
161
164
|
has_report :monetized_playbacks, Integer
|
162
165
|
|
163
166
|
### STATISTICS ###
|
data/lib/yt/models/playlist.rb
CHANGED
@@ -160,16 +160,16 @@ module Yt
|
|
160
160
|
# @macro report_by_gender_and_age_group
|
161
161
|
has_report :viewer_percentage, Float
|
162
162
|
|
163
|
-
# @macro
|
163
|
+
# @macro report_by_day_and_state
|
164
164
|
has_report :average_view_duration, Float
|
165
165
|
|
166
|
-
# @macro
|
166
|
+
# @macro report_by_day_and_state
|
167
167
|
has_report :playlist_starts, Integer
|
168
168
|
|
169
|
-
# @macro
|
169
|
+
# @macro report_by_day_and_state
|
170
170
|
has_report :average_time_in_playlist, Float
|
171
171
|
|
172
|
-
# @macro
|
172
|
+
# @macro report_by_day_and_state
|
173
173
|
has_report :views_per_playlist_start, Float
|
174
174
|
|
175
175
|
### PRIVATE API ###
|
data/lib/yt/models/video.rb
CHANGED
@@ -375,62 +375,65 @@ module Yt
|
|
375
375
|
# @macro report_by_video_dimensions
|
376
376
|
has_report :views, Integer
|
377
377
|
|
378
|
+
# @macro report_by_day
|
379
|
+
has_report :uniques, Integer
|
380
|
+
|
378
381
|
# @macro report_by_video_dimensions
|
379
382
|
has_report :estimated_minutes_watched, Float
|
380
383
|
|
381
384
|
# @macro report_by_gender_and_age_group
|
382
385
|
has_report :viewer_percentage, Float
|
383
386
|
|
384
|
-
# @macro
|
387
|
+
# @macro report_by_day_and_country
|
385
388
|
has_report :comments, Integer
|
386
389
|
|
387
|
-
# @macro
|
390
|
+
# @macro report_by_day_and_country
|
388
391
|
has_report :likes, Integer
|
389
392
|
|
390
|
-
# @macro
|
393
|
+
# @macro report_by_day_and_country
|
391
394
|
has_report :dislikes, Integer
|
392
395
|
|
393
|
-
# @macro
|
396
|
+
# @macro report_by_day_and_country
|
394
397
|
has_report :shares, Integer
|
395
398
|
|
396
399
|
# @note This is not the total number of subscribers gained by the video’s
|
397
400
|
# channel, but the subscribers gained *from* the video’s page.
|
398
|
-
# @macro
|
401
|
+
# @macro report_by_day_and_country
|
399
402
|
has_report :subscribers_gained, Integer
|
400
403
|
|
401
404
|
# @note This is not the total number of subscribers lost by the video’s
|
402
405
|
# channel, but the subscribers lost *from* the video’s page.
|
403
|
-
# @macro
|
406
|
+
# @macro report_by_day_and_country
|
404
407
|
has_report :subscribers_lost, Integer
|
405
408
|
|
406
|
-
# @macro
|
409
|
+
# @macro report_by_day_and_country
|
407
410
|
has_report :favorites_added, Integer
|
408
411
|
|
409
|
-
# @macro
|
412
|
+
# @macro report_by_day_and_country
|
410
413
|
has_report :favorites_removed, Integer
|
411
414
|
|
412
|
-
# @macro
|
415
|
+
# @macro report_by_day_and_state
|
413
416
|
has_report :average_view_duration, Float
|
414
417
|
|
415
|
-
# @macro
|
418
|
+
# @macro report_by_day_and_state
|
416
419
|
has_report :average_view_percentage, Float
|
417
420
|
|
418
|
-
# @macro
|
421
|
+
# @macro report_by_day_and_state
|
419
422
|
has_report :annotation_clicks, Integer
|
420
423
|
|
421
|
-
# @macro
|
424
|
+
# @macro report_by_day_and_state
|
422
425
|
has_report :annotation_click_through_rate, Float
|
423
426
|
|
424
|
-
# @macro
|
427
|
+
# @macro report_by_day_and_state
|
425
428
|
has_report :annotation_close_rate, Float
|
426
429
|
|
427
|
-
# @macro
|
430
|
+
# @macro report_by_day_and_country
|
428
431
|
has_report :earnings, Float
|
429
432
|
|
430
|
-
# @macro
|
433
|
+
# @macro report_by_day_and_country
|
431
434
|
has_report :impressions, Integer
|
432
435
|
|
433
|
-
# @macro
|
436
|
+
# @macro report_by_day_and_country
|
434
437
|
has_report :monetized_playbacks, Integer
|
435
438
|
|
436
439
|
### STATISTICS ###
|