yt 0.14.6 → 0.14.7

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
2
  SHA1:
3
- metadata.gz: a7478bc266207deb9b62eceee6facd2759140bb7
4
- data.tar.gz: f6a7b9d716a9af97840ca80f9f8d7b8dd8f8e3ef
3
+ metadata.gz: e26f7e87270dc0509123f5ea88302a280e54da66
4
+ data.tar.gz: 73f82aca406690352fb266e2129bc4288be40f4a
5
5
  SHA512:
6
- metadata.gz: 34c8f6da13b7eb077dfc53a4e79c2edc4221c790b634d4b86eb9458f53b0baa16b7d4617beba4f66887e5ed7a11f1ff4259301438ad4e039c8e56a724ac2aa38
7
- data.tar.gz: dc781c9d0e8ead0f7f117ce6e6e2a4596dbf0e1253489db187e5690f68cdd59d7dd22ad9396e991af9b6444779d851e26f04c821c95985c5a623cfb7ffc0cccd
6
+ metadata.gz: 7c113de8d650081766da2ba86cbc85e2e038e02cf2e8f358ab76feabeacae8ca2fc5d29447e68608a0a31d2466177fe44722b4bfe2d25a40cb1004e7edfa2a50
7
+ data.tar.gz: 6600285bcf6beb7fb56d38bdb555cba51e745a0237c2a21059f9b3905faeec6487866b1deb3b028751b67a4d31fb2a27684c9f9bd63ea2f5eb12bdbdd7538c3b
@@ -6,6 +6,10 @@ 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.14.7 - 2015-04-17
10
+
11
+ * [FEATURE] New `by: :device_type` option for reports, to return views and estimated watched minutes (channels) by device
12
+
9
13
  ## 0.14.6 - 2015-04-17
10
14
 
11
15
  * [BUGFIX] Rescue OpenSSL::SSL::SSLErrorWaitReadable only on version of Ruby that define it.
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.14.6'
44
+ gem 'yt', '~> 0.14.7'
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*)
@@ -155,6 +155,7 @@ Use [Yt::Channel](http://rubydoc.info/github/Fullscreen/yt/master/Yt/Models/Chan
155
155
  * retrieve the views and estimated minutes watched by related video
156
156
  * retrieve the views and estimated minutes watched by video
157
157
  * retrieve the views and estimated minutes watched by playlist
158
+ * retrieve the views and estimated minutes watched by device type
158
159
  * retrieve the viewer percentage of a channel by gender and age group
159
160
 
160
161
  ```ruby
@@ -234,6 +235,9 @@ channel.estimated_minutes_watched since: 7.days.ago, by: :video #=> {#<Yt::Model
234
235
 
235
236
  channel.views since: 7.days.ago, by: :playlist #=> {#<Yt::Models::Playlist @id=...>: 10.0, #<Yt::Models::Playlist @id=...>: 20.0, …}
236
237
  channel.estimated_minutes_watched since: 7.days.ago, by: :playlist #=> {#<Yt::Models::Playlist @id=...>: 10.0, #<Yt::Models::Playlist @id=...>: 20.0, …}
238
+
239
+ channel.views since: 7.days.ago, by: :device_type #=> {mobile: 144473.0, unknown_platform: 840.0, game_console: 4940.0, desktop: 102889.0, tv: 4134.0, tablet: 50189.0}
240
+ channel.estimated_minutes_watched since: 7.days.ago, by: :device_type #=> {mobile: 144473.0, unknown_platform: 840.0, game_console: 4940.0, desktop: 102889.0, tv: 4134.0, tablet: 50189.0}
237
241
  ```
238
242
 
239
243
  *The methods above require to be authenticated as the channel’s account (see below).*
@@ -268,6 +272,8 @@ channel.views since: 7.days.ago, by: :video #=> {#<Yt::Models::Video @id=...>: 1
268
272
  channel.estimated_minutes_watched since: 7.days.ago, by: :video #=> {#<Yt::Models::Video @id=...>: 10.0, #<Yt::Models::Video @id=...>: 20.0, …}
269
273
  channel.views since: 7.days.ago, by: :playlist #=> {#<Yt::Models::Playlist @id=...>: 10.0, #<Yt::Models::Playlist @id=...>: 20.0, …}
270
274
  channel.estimated_minutes_watched since: 7.days.ago, by: :playlist #=> {#<Yt::Models::Playlist @id=...>: 10.0, #<Yt::Models::Playlist @id=...>: 20.0, …}
275
+ channel.views since: 7.days.ago, by: :device_type #=> {mobile: 144473.0, unknown_platform: 840.0, game_console: 4940.0, desktop: 102889.0, tv: 4134.0, tablet: 50189.0}
276
+ channel.estimated_minutes_watched since: 7.days.ago, by: :device_type #=> {mobile: 144473.0, unknown_platform: 840.0, game_console: 4940.0, desktop: 102889.0, tv: 4134.0, tablet: 50189.0}
271
277
  channel.monetized_playbacks_on 5.days.ago #=> 123.0
272
278
 
273
279
  channel.content_owner #=> 'CMSname'
@@ -292,6 +298,7 @@ Use [Yt::Video](http://rubydoc.info/github/Fullscreen/yt/master/Yt/Models/Video)
292
298
  * retrieve the views of a video by playback location
293
299
  * retrieve the views of a video by embedded player location
294
300
  * retrieve the views of a video by related video
301
+ * retrieve the views of a video by device type
295
302
  * retrieve the viewer percentage of a video by gender and age group
296
303
  * retrieve data about live-streaming videos
297
304
  * retrieve the advertising options of a video
@@ -396,6 +403,7 @@ video.views since: 7.days.ago, by: :traffic_source #=> {advertising: 10.0, relat
396
403
  video.views since: 7.days.ago, by: :playback_location #=> {:embedded=>6.0, :watch=>11.0}
397
404
  video.views since: 7.days.ago, by: :embedded_player_location #=> {"fullscreen.net"=>45.0, "linkedin.com"=>5.0, "mashable.com"=>1.0, "unknown"=>1.0}
398
405
  video.views since: 7.days.ago, by: :related_video #=> {#<Yt::Models::Video @id=...>: 10.0, #<Yt::Models::Video @id=...>: 20.0, …}
406
+ video.views since: 7.days.ago, by: :device_type #=> {mobile: 144473.0, unknown_platform: 840.0, game_console: 4940.0, desktop: 102889.0, tv: 4134.0, tablet: 50189.0}
399
407
 
400
408
  video.delete #=> true
401
409
  ```
@@ -10,6 +10,7 @@ module Yt
10
10
  hash[:related_video] = {name: 'insightTrafficSourceDetail', parse: ->(video_id) { Yt::Video.new id: video_id, auth: @auth } }
11
11
  hash[:video] = {name: 'video', parse: ->(video_id) { Yt::Video.new id: video_id, auth: @auth } }
12
12
  hash[:playlist] = {name: 'playlist', parse: ->(playlist_id) { Yt::Playlist.new id: playlist_id, auth: @auth } }
13
+ hash[:device_type] = {name: 'deviceType', parse: ->(type) { type.downcase.to_sym } }
13
14
  end
14
15
 
15
16
  # @see https://developers.google.com/youtube/analytics/v1/dimsmets/dims#Traffic_Source_Dimensions
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.14.6'
2
+ VERSION = '0.14.7'
3
3
  end
@@ -158,6 +158,16 @@ describe Yt::Channel, :partner do
158
158
  end
159
159
  end
160
160
 
161
+ describe 'views can be grouped by device type' do
162
+ let(:range) { {since: 4.days.ago, until: 3.days.ago} }
163
+
164
+ specify 'with the :by option set to :device_type' do
165
+ views = channel.views range.merge by: :device_type
166
+ expect(views.keys).to all(be_instance_of Symbol)
167
+ expect(views.values).to all(be_instance_of Float)
168
+ end
169
+ end
170
+
161
171
  describe 'comments can be retrieved for a specific day' do
162
172
  context 'in which the channel was partnered' do
163
173
  let(:comments) { channel.comments_on 5.days.ago}
@@ -637,6 +647,16 @@ describe Yt::Channel, :partner do
637
647
  end
638
648
  end
639
649
 
650
+ describe 'estimated minutes watched can be grouped by device type' do
651
+ let(:range) { {since: 4.days.ago, until: 3.days.ago} }
652
+
653
+ specify 'with the :by option set to :device_type' do
654
+ estimated_minutes_watched = channel.estimated_minutes_watched range.merge by: :device_type
655
+ expect(estimated_minutes_watched.keys).to all(be_instance_of Symbol)
656
+ expect(estimated_minutes_watched.values).to all(be_instance_of Float)
657
+ end
658
+ end
659
+
640
660
  describe 'average view duration can be retrieved for a specific day' do
641
661
  context 'in which the channel was partnered' do
642
662
  let(:average_view_duration) { channel.average_view_duration_on 5.days.ago}
@@ -130,6 +130,16 @@ describe Yt::Video, :partner do
130
130
  end
131
131
  end
132
132
 
133
+ describe 'views can be grouped by device type' do
134
+ let(:range) { {since: 4.days.ago, until: 3.days.ago} }
135
+
136
+ specify 'with the :by option set to :device_type' do
137
+ views = video.views range.merge by: :device_type
138
+ expect(views.keys).to all(be_instance_of Symbol)
139
+ expect(views.values).to all(be_instance_of Float)
140
+ end
141
+ end
142
+
133
143
  describe 'comments can be retrieved for a specific day' do
134
144
  context 'in which the video was partnered' do
135
145
  let(:comments) { video.comments_on 5.days.ago}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.6
4
+ version: 0.14.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo