yt 0.25.5 → 0.25.6

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: 50ce20802b231f960b7dbfd04ff5ee5783921fb7
4
- data.tar.gz: c51ce48786243feb765a256a76292e44b88b69a5
3
+ metadata.gz: 4906f2b9b0a43d68f1c2bc2e60bb629da1c976b8
4
+ data.tar.gz: 35ebf6686a6821d9a71cc73d721b814c1e094261
5
5
  SHA512:
6
- metadata.gz: 9dee78a67ae1f95c649dfc4ca5db80e5a015d4e2aeb9d1be6ece9360bb1990677f20ed3cd7a295516af8d2ba72d1c308e90a6b9f80025cab7ffcfc3a7a31c81f
7
- data.tar.gz: e3a2e50ceb3c87f3c3eda04e2c984219f52be32bd33c4cc01caeaab6e4363c3bf8cec1617b37a4891ac13cd6cb7ccff4be0265d8b522a3a8cb897172397085c0
6
+ metadata.gz: e59bb56d0fce3c1bf71b156af6a35d4373cf03c05ddc22c94ad1705cd39098d2f1379a0eb48859bf98af2d959a81ed4e20e77b01dd5d3faa29159653a1653bf3
7
+ data.tar.gz: 9ef78181e2dc8ecfec9742288e119cddf3ad75e164df0dc6a90b0f2d1fc1c31ab59a8f49d36ccb7b406e744254be33e925eb6b478f5af6f482edb602f51f9cc7
@@ -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.25.6 - 2015-09-03
10
+
11
+ * [FEATURE] New channel/video reports: `videos_added_to_playlists`, `videos_removed_from_playlists`.
12
+
9
13
  ## 0.25.5 - 2015-08-12
10
14
 
11
15
  * [BUGIX] Correctly parse the YouTube response when requesting a refresh token with the wrong credentials.
@@ -147,6 +147,12 @@ module Yt
147
147
  # @macro report_by_day_and_country
148
148
  has_report :favorites_removed, Integer
149
149
 
150
+ # @macro report_by_day_and_country
151
+ has_report :videos_added_to_playlists, Integer
152
+
153
+ # @macro report_by_day_and_country
154
+ has_report :videos_removed_from_playlists, Integer
155
+
150
156
  # @macro report_by_day_and_state
151
157
  has_report :average_view_duration, Integer
152
158
 
@@ -420,6 +420,12 @@ module Yt
420
420
  # @macro report_by_day_and_country
421
421
  has_report :favorites_removed, Integer
422
422
 
423
+ # @macro report_by_day_and_country
424
+ has_report :videos_added_to_playlists, Integer
425
+
426
+ # @macro report_by_day_and_country
427
+ has_report :videos_removed_from_playlists, Integer
428
+
423
429
  # @macro report_by_day_and_state
424
430
  has_report :average_view_duration, Integer
425
431
 
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.25.5'
2
+ VERSION = '0.25.6'
3
3
  end
@@ -204,6 +204,8 @@ describe Yt::Channel, :device_app do
204
204
  expect{channel.subscribers_lost}.not_to raise_error
205
205
  expect{channel.favorites_added}.not_to raise_error
206
206
  expect{channel.favorites_removed}.not_to raise_error
207
+ expect{channel.videos_added_to_playlists}.not_to raise_error
208
+ expect{channel.videos_removed_from_playlists}.not_to raise_error
207
209
  expect{channel.estimated_minutes_watched}.not_to raise_error
208
210
  expect{channel.average_view_duration}.not_to raise_error
209
211
  expect{channel.average_view_percentage}.not_to raise_error
@@ -225,6 +227,8 @@ describe Yt::Channel, :device_app do
225
227
  expect{channel.subscribers_lost_on 3.days.ago}.not_to raise_error
226
228
  expect{channel.favorites_added_on 3.days.ago}.not_to raise_error
227
229
  expect{channel.favorites_removed_on 3.days.ago}.not_to raise_error
230
+ expect{channel.videos_added_to_playlists_on 3.days.ago}.not_to raise_error
231
+ expect{channel.videos_removed_from_playlists_on 3.days.ago}.not_to raise_error
228
232
  expect{channel.estimated_minutes_watched_on 3.days.ago}.not_to raise_error
229
233
  expect{channel.average_view_duration_on 3.days.ago}.not_to raise_error
230
234
  expect{channel.average_view_percentage_on 3.days.ago}.not_to raise_error
@@ -292,6 +292,8 @@ describe Yt::Video, :device_app do
292
292
  expect{video.subscribers_lost}.not_to raise_error
293
293
  expect{video.favorites_added}.not_to raise_error
294
294
  expect{video.favorites_removed}.not_to raise_error
295
+ expect{video.videos_added_to_playlists}.not_to raise_error
296
+ expect{video.videos_removed_from_playlists}.not_to raise_error
295
297
  expect{video.estimated_minutes_watched}.not_to raise_error
296
298
  expect{video.average_view_duration}.not_to raise_error
297
299
  expect{video.average_view_percentage}.not_to raise_error
@@ -314,6 +316,8 @@ describe Yt::Video, :device_app do
314
316
  expect{video.subscribers_lost_on 3.days.ago}.not_to raise_error
315
317
  expect{video.favorites_added_on 3.days.ago}.not_to raise_error
316
318
  expect{video.favorites_removed_on 3.days.ago}.not_to raise_error
319
+ expect{video.videos_added_to_playlists_on 3.days.ago}.not_to raise_error
320
+ expect{video.videos_removed_from_playlists_on 3.days.ago}.not_to raise_error
317
321
  expect{video.estimated_minutes_watched_on 3.days.ago}.not_to raise_error
318
322
  expect{video.average_view_duration_on 3.days.ago}.not_to raise_error
319
323
  expect{video.average_view_percentage_on 3.days.ago}.not_to raise_error
@@ -15,6 +15,7 @@ describe Yt::Channel, :partner do
15
15
  estimated_minutes_watched: Integer, comments: Integer, likes: Integer,
16
16
  dislikes: Integer, shares: Integer, subscribers_gained: Integer,
17
17
  subscribers_lost: Integer, favorites_added: Integer,
18
+ videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
18
19
  favorites_removed: Integer, average_view_duration: Integer,
19
20
  average_view_percentage: Float, annotation_clicks: Integer,
20
21
  annotation_click_through_rate: Float,
@@ -58,6 +59,7 @@ describe Yt::Channel, :partner do
58
59
 
59
60
  [:views, :uniques, :comments, :likes, :dislikes, :shares,
60
61
  :subscribers_gained, :subscribers_lost, :favorites_added,
62
+ :videos_added_to_playlists, :videos_removed_from_playlists,
61
63
  :favorites_removed, :estimated_minutes_watched, :average_view_duration,
62
64
  :average_view_percentage, :impressions, :monetized_playbacks,
63
65
  :annotation_clicks, :annotation_click_through_rate, :playback_based_cpm,
@@ -117,6 +119,7 @@ describe Yt::Channel, :partner do
117
119
  estimated_minutes_watched: Integer, average_view_duration: Integer,
118
120
  annotation_clicks: Integer, annotation_click_through_rate: Float,
119
121
  favorites_added: Integer, favorites_removed: Integer,
122
+ videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
120
123
  average_view_percentage: Float, impressions: Integer,
121
124
  shares: Integer, playback_based_cpm: Float,
122
125
  monetized_playbacks: Integer, annotation_close_rate: Float,
@@ -983,6 +986,116 @@ describe Yt::Channel, :partner do
983
986
  end
984
987
  end
985
988
 
989
+ describe 'videos added to playlists can be retrieved for a single country' do
990
+ let(:country_code) { 'US' }
991
+ let(:videos_added_to_playlists) { channel.videos_added_to_playlists since: date, by: by, in: location }
992
+ let(:date) { ENV['YT_TEST_PARTNER_VIDEO_DATE'] }
993
+
994
+ context 'and grouped by day' do
995
+ let(:by) { :day }
996
+
997
+ context 'with the :in option set to the country code' do
998
+ let(:location) { country_code }
999
+ it { expect(videos_added_to_playlists.keys.min).to eq date.to_date }
1000
+ end
1001
+
1002
+ context 'with the :in option set to {country: country code}' do
1003
+ let(:location) { {country: country_code} }
1004
+ it { expect(videos_added_to_playlists.keys.min).to eq date.to_date }
1005
+ end
1006
+ end
1007
+
1008
+ context 'and grouped by country' do
1009
+ let(:by) { :country }
1010
+
1011
+ context 'with the :in option set to the country code' do
1012
+ let(:location) { country_code }
1013
+ it { expect(videos_added_to_playlists.keys).to eq [country_code] }
1014
+ end
1015
+
1016
+ context 'with the :in option set to {country: country code}' do
1017
+ let(:location) { {country: country_code} }
1018
+ it { expect(videos_added_to_playlists.keys).to eq [country_code] }
1019
+ end
1020
+ end
1021
+ end
1022
+
1023
+ describe 'added favorites can be grouped by day' do
1024
+ let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
1025
+ let(:keys) { range.values }
1026
+
1027
+ specify 'with the :by option set to :day' do
1028
+ videos_added_to_playlists = channel.videos_added_to_playlists range.merge by: :day
1029
+ expect(videos_added_to_playlists.keys).to eq range.values
1030
+ end
1031
+ end
1032
+
1033
+ describe 'added favorites can be grouped by country' do
1034
+ let(:range) { {since: 4.days.ago, until: 3.days.ago} }
1035
+
1036
+ specify 'with the :by option set to :country' do
1037
+ videos_added_to_playlists = channel.videos_added_to_playlists range.merge by: :country
1038
+ expect(videos_added_to_playlists.keys).to all(be_a String)
1039
+ expect(videos_added_to_playlists.keys.map(&:length).uniq).to eq [2]
1040
+ expect(videos_added_to_playlists.values).to all(be_an Integer)
1041
+ end
1042
+ end
1043
+
1044
+ describe 'videos removed from playlists can be retrieved for a single country' do
1045
+ let(:country_code) { 'US' }
1046
+ let(:videos_removed_from_playlists) { channel.videos_removed_from_playlists since: date, by: by, in: location }
1047
+ let(:date) { ENV['YT_TEST_PARTNER_VIDEO_DATE'] }
1048
+
1049
+ context 'and grouped by day' do
1050
+ let(:by) { :day }
1051
+
1052
+ context 'with the :in option set to the country code' do
1053
+ let(:location) { country_code }
1054
+ it { expect(videos_removed_from_playlists.keys.min).to eq date.to_date }
1055
+ end
1056
+
1057
+ context 'with the :in option set to {country: country code}' do
1058
+ let(:location) { {country: country_code} }
1059
+ it { expect(videos_removed_from_playlists.keys.min).to eq date.to_date }
1060
+ end
1061
+ end
1062
+
1063
+ context 'and grouped by country' do
1064
+ let(:by) { :country }
1065
+
1066
+ context 'with the :in option set to the country code' do
1067
+ let(:location) { country_code }
1068
+ it { expect(videos_removed_from_playlists.keys).to eq [country_code] }
1069
+ end
1070
+
1071
+ context 'with the :in option set to {country: country code}' do
1072
+ let(:location) { {country: country_code} }
1073
+ it { expect(videos_removed_from_playlists.keys).to eq [country_code] }
1074
+ end
1075
+ end
1076
+ end
1077
+
1078
+ describe 'removed favorites can be grouped by day' do
1079
+ let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
1080
+ let(:keys) { range.values }
1081
+
1082
+ specify 'with the :by option set to :day' do
1083
+ videos_removed_from_playlists = channel.videos_removed_from_playlists range.merge by: :day
1084
+ expect(videos_removed_from_playlists.keys).to eq range.values
1085
+ end
1086
+ end
1087
+
1088
+ describe 'removed favorites can be grouped by country' do
1089
+ let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE'], until: Date.parse(ENV['YT_TEST_PARTNER_VIDEO_DATE']) + 5} }
1090
+
1091
+ specify 'with the :by option set to :country' do
1092
+ videos_removed_from_playlists = channel.videos_removed_from_playlists range.merge by: :country
1093
+ expect(videos_removed_from_playlists.keys).to all(be_a String)
1094
+ expect(videos_removed_from_playlists.keys.map(&:length).uniq).to eq [2]
1095
+ expect(videos_removed_from_playlists.values).to all(be_an Integer)
1096
+ end
1097
+ end
1098
+
986
1099
  describe 'estimated minutes watched can be retrieved for a single country' do
987
1100
  let(:country_code) { 'US' }
988
1101
  let(:estimated_minutes_watched) { channel.estimated_minutes_watched since: date, by: by, in: location }
@@ -15,6 +15,7 @@ describe Yt::Video, :partner do
15
15
 
16
16
  [:views, :uniques, :comments, :likes, :dislikes, :shares,
17
17
  :subscribers_gained, :subscribers_lost, :favorites_added,
18
+ :videos_added_to_playlists, :videos_removed_from_playlists,
18
19
  :favorites_removed, :estimated_minutes_watched, :average_view_duration,
19
20
  :average_view_percentage, :impressions, :monetized_playbacks,
20
21
  :annotation_clicks, :annotation_click_through_rate, :playback_based_cpm,
@@ -111,6 +112,7 @@ describe Yt::Video, :partner do
111
112
  {views: Integer, comments: Integer, likes: Integer, dislikes: Integer,
112
113
  shares: Integer, subscribers_gained: Integer, subscribers_lost: Integer,
113
114
  favorites_added: Integer,
115
+ videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
114
116
  estimated_minutes_watched: Integer, average_view_duration: Integer,
115
117
  average_view_percentage: Float, impressions: Integer,
116
118
  monetized_playbacks: Integer, annotation_clicks: Integer,
@@ -162,6 +164,7 @@ describe Yt::Video, :partner do
162
164
 
163
165
  [:views, :comments, :likes, :dislikes, :shares,
164
166
  :subscribers_gained, :subscribers_lost, :favorites_added,
167
+ :videos_added_to_playlists, :videos_removed_from_playlists,
165
168
  :estimated_minutes_watched, :average_view_duration,
166
169
  :average_view_percentage, :impressions, :monetized_playbacks,
167
170
  :annotation_clicks, :annotation_click_through_rate,
@@ -211,6 +214,7 @@ describe Yt::Video, :partner do
211
214
  estimated_minutes_watched: Integer, comments: Integer, likes: Integer,
212
215
  dislikes: Integer, shares: Integer, subscribers_gained: Integer,
213
216
  subscribers_lost: Integer, favorites_added: Integer,
217
+ videos_added_to_playlists: Integer, videos_removed_from_playlists: Integer,
214
218
  favorites_removed: Integer, average_view_duration: Integer,
215
219
  average_view_percentage: Float, annotation_clicks: Integer,
216
220
  annotation_click_through_rate: Float,
@@ -575,6 +579,48 @@ describe Yt::Video, :partner do
575
579
  end
576
580
  end
577
581
 
582
+ describe 'added to playlists can be grouped by day' do
583
+ let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
584
+ let(:keys) { range.values }
585
+
586
+ specify 'with the :by option set to :day' do
587
+ videos_added_to_playlists = video.videos_added_to_playlists range.merge by: :day
588
+ expect(videos_added_to_playlists.keys).to eq range.values
589
+ end
590
+ end
591
+
592
+ describe 'added to playlists can be grouped by country' do
593
+ let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE']} }
594
+
595
+ specify 'with the :by option set to :country' do
596
+ videos_added_to_playlists = video.videos_added_to_playlists range.merge by: :country
597
+ expect(videos_added_to_playlists.keys).to all(be_a String)
598
+ expect(videos_added_to_playlists.keys.map(&:length).uniq).to eq [2]
599
+ expect(videos_added_to_playlists.values).to all(be_an Integer)
600
+ end
601
+ end
602
+
603
+ describe 'removed from playlists can be grouped by day' do
604
+ let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
605
+ let(:keys) { range.values }
606
+
607
+ specify 'with the :by option set to :day' do
608
+ videos_removed_from_playlists = video.videos_removed_from_playlists range.merge by: :day
609
+ expect(videos_removed_from_playlists.keys).to eq range.values
610
+ end
611
+ end
612
+
613
+ describe 'removed from playlists can be grouped by country' do
614
+ let(:range) { {since: ENV['YT_TEST_PARTNER_VIDEO_DATE']} }
615
+
616
+ specify 'with the :by option set to :country' do
617
+ videos_removed_from_playlists = video.videos_removed_from_playlists range.merge by: :country
618
+ expect(videos_removed_from_playlists.keys).to all(be_a String)
619
+ expect(videos_removed_from_playlists.keys.map(&:length).uniq).to eq [2]
620
+ expect(videos_removed_from_playlists.values).to all(be_an Integer)
621
+ end
622
+ end
623
+
578
624
  describe 'added favorites can be grouped by day' do
579
625
  let(:range) { {since: 4.days.ago.to_date, until: 3.days.ago.to_date} }
580
626
  let(:keys) { range.values }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.5
4
+ version: 0.25.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-12 00:00:00.000000000 Z
11
+ date: 2015-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  version: '0'
313
313
  requirements: []
314
314
  rubyforge_project:
315
- rubygems_version: 2.4.5
315
+ rubygems_version: 2.4.5.1
316
316
  signing_key:
317
317
  specification_version: 4
318
318
  summary: Yt makes it easy to interact with Youtube V3 API by providing a modular,