yt 0.13.11 → 0.13.12

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: 786cbb9164a2e2b754ce54f81a003d8fee3abc05
4
- data.tar.gz: cdb45f6cb5c1dfc7a8241a9a75862513db54336d
3
+ metadata.gz: 61bf48f535309263dd745a133cb3d41c05eb93a2
4
+ data.tar.gz: 63bc4f48576730c827894c59b5884067dcac9295
5
5
  SHA512:
6
- metadata.gz: c66811d1d74ee081d1fd00864c8668e1a053d6326892c6fd4d999524b913514cf2753f29c3926e2124a31505ecd9689a8e15fa660a5470af84f9b40468b50c18
7
- data.tar.gz: 598db011f908c5d8200601abe755aea2571233c0d41fb5627397ea268efff5c8a2ab30d61e86f368ccc9a47f94f8888ff27eec66c6a6454f12cf8ad77233391d
6
+ metadata.gz: b627fd0536a0c09944fb73766d272a7c961dc271cc42aad92cd0a8748a33085e8f52aa5b54d096bdd39e0920ee59d77930b8c311b84aa53ff0c0a8b8961db7e1
7
+ data.tar.gz: a27c7014ed9d101d8305456edf31764145827b680cfabcc00c8841451fe73240e77d2e0160ba25342575d87ef88c6126a2b337f1de69c3b49812b451d5bffa4b
@@ -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.13.12 - 2015-03-23
10
+
11
+ * [FEATURE] New channel/video reports: `favorites_added`, `favorites_removed`.
12
+
9
13
  ## 0.13.11 - 2015-02-27
10
14
 
11
15
  * [FEATURE] New channel reports: `subscribers_gained`, `subscribers_lost`.
data/README.md CHANGED
@@ -203,6 +203,8 @@ channel.dislikes to: 2.days.ago #=> {Tue, 27 May 2014 => 0.0, Wed, 28 May 2014 =
203
203
  channel.shares since: 7.days.ago, until: 7.days.ago #=> {Wed, 28 May 2014 => 3.0}
204
204
  channel.subscribers_gained from: '2014-08-30', to: '2014-08-31' #=> {Sat, 30 Aug 2014=>1.0, Sun, 31 Aug 2014=>0.0}
205
205
  channel.subscribers_lost from: '2014-08-30', to: '2014-08-31' #=> {Sat, 30 Aug 2014=>0.0, Sun, 31 Aug 2014=>0.0}
206
+ channel.favorites_added from: '2014-08-30', to: '2014-08-31' #=> {Sat, 30 Aug 2014=>1.0, Sun, 31 Aug 2014=>0.0}
207
+ channel.favorites_removed from: '2014-08-30', to: '2014-08-31' #=> {Sat, 30 Aug 2014=>0.0, Sun, 31 Aug 2014=>0.0}
206
208
  channel.estimated_minutes_watched #=> {Sun, 22 Feb 2015=>2433258.0, Mon, 23 Feb 2015=>2634360.0, …}
207
209
  channel.average_view_duration #=> {Sun, 22 Feb 2015=>329.0, Mon, 23 Feb 2015=>326.0, …}
208
210
  channel.average_view_percentage # {Sun, 22 Feb 2015=>38.858253094977265, Mon, 23 Feb 2015=>37.40014235438217, …}
@@ -9,7 +9,7 @@ module Yt
9
9
  class References < Base
10
10
  def insert(attributes = {})
11
11
  underscore_keys! attributes
12
- body = {content_type: attributes[:content_type] }
12
+ body = attributes.slice(*body_params)
13
13
  params = {claim_id: attributes[:claim_id], on_behalf_of_content_owner: @auth.owner_name}
14
14
  do_insert(params: params, body: body)
15
15
  end
@@ -37,6 +37,10 @@ module Yt
37
37
  def references_params
38
38
  apply_where_params! on_behalf_of_content_owner: @parent.owner_name
39
39
  end
40
+
41
+ def body_params
42
+ [:content_type, :audioswap_enabled, :ignore_fps_match, :excluded_intervals]
43
+ end
40
44
  end
41
45
  end
42
- end
46
+ end
@@ -37,6 +37,12 @@ module Yt
37
37
  # @macro has_report
38
38
  has_report :subscribers_lost
39
39
 
40
+ # @macro has_report
41
+ has_report :favorites_added
42
+
43
+ # @macro has_report
44
+ has_report :favorites_removed
45
+
40
46
  # @macro has_report
41
47
  has_report :estimated_minutes_watched
42
48
 
@@ -68,6 +68,12 @@ module Yt
68
68
  # channel, but the subscribers lost *from* the video’s page.
69
69
  has_report :subscribers_lost
70
70
 
71
+ # @macro has_report
72
+ has_report :favorites_added
73
+
74
+ # @macro has_report
75
+ has_report :favorites_removed
76
+
71
77
  # @macro has_report
72
78
  has_report :impressions
73
79
 
@@ -1,3 +1,3 @@
1
1
  module Yt
2
- VERSION = '0.13.11'
2
+ VERSION = '0.13.12'
3
3
  end
@@ -132,6 +132,8 @@ describe Yt::Channel, :device_app do
132
132
  expect{channel.shares}.not_to raise_error
133
133
  expect{channel.subscribers_gained}.not_to raise_error
134
134
  expect{channel.subscribers_lost}.not_to raise_error
135
+ expect{channel.favorites_added}.not_to raise_error
136
+ expect{channel.favorites_removed}.not_to raise_error
135
137
  expect{channel.estimated_minutes_watched}.not_to raise_error
136
138
  expect{channel.average_view_duration}.not_to raise_error
137
139
  expect{channel.average_view_percentage}.not_to raise_error
@@ -145,6 +147,8 @@ describe Yt::Channel, :device_app do
145
147
  expect{channel.shares_on 3.days.ago}.not_to raise_error
146
148
  expect{channel.subscribers_gained_on 3.days.ago}.not_to raise_error
147
149
  expect{channel.subscribers_lost_on 3.days.ago}.not_to raise_error
150
+ expect{channel.favorites_added_on 3.days.ago}.not_to raise_error
151
+ expect{channel.favorites_removed_on 3.days.ago}.not_to raise_error
148
152
  expect{channel.estimated_minutes_watched_on 3.days.ago}.not_to raise_error
149
153
  expect{channel.average_view_duration_on 3.days.ago}.not_to raise_error
150
154
  expect{channel.average_view_percentage_on 3.days.ago}.not_to raise_error
@@ -287,6 +287,8 @@ describe Yt::Video, :device_app do
287
287
  expect{video.shares}.not_to raise_error
288
288
  expect{video.subscribers_gained}.not_to raise_error
289
289
  expect{video.subscribers_lost}.not_to raise_error
290
+ expect{video.favorites_added}.not_to raise_error
291
+ expect{video.favorites_removed}.not_to raise_error
290
292
  expect{video.earnings}.to raise_error Yt::Errors::Unauthorized
291
293
  expect{video.impressions}.to raise_error Yt::Errors::Unauthorized
292
294
  expect{video.monetized_playbacks}.to raise_error Yt::Errors::Unauthorized
@@ -299,6 +301,8 @@ describe Yt::Video, :device_app do
299
301
  expect{video.shares_on 3.days.ago}.not_to raise_error
300
302
  expect{video.subscribers_gained_on 3.days.ago}.not_to raise_error
301
303
  expect{video.subscribers_lost_on 3.days.ago}.not_to raise_error
304
+ expect{video.favorites_added_on 3.days.ago}.not_to raise_error
305
+ expect{video.favorites_removed_on 3.days.ago}.not_to raise_error
302
306
  expect{video.earnings_on 3.days.ago}.to raise_error Yt::Errors::Unauthorized
303
307
  expect{video.impressions_on 3.days.ago}.to raise_error Yt::Errors::Unauthorized
304
308
  end
@@ -278,6 +278,70 @@ describe Yt::Channel, :partner do
278
278
  end
279
279
  end
280
280
 
281
+ describe 'added favorites can be retrieved for a specific day' do
282
+ context 'in which the channel was partnered' do
283
+ let(:favorites_added) { channel.favorites_added_on 5.days.ago}
284
+ it { expect(favorites_added).to be_a Float }
285
+ end
286
+
287
+ context 'in which the channel was not partnered' do
288
+ let(:favorites_added) { channel.favorites_added_on 20.years.ago}
289
+ it { expect(favorites_added).to be_nil }
290
+ end
291
+ end
292
+
293
+ describe 'added favorites can be retrieved for a range of days' do
294
+ let(:date) { 4.days.ago }
295
+
296
+ specify 'with a given start (:since option)' do
297
+ expect(channel.favorites_added(since: date).keys.min).to eq date.to_date
298
+ end
299
+
300
+ specify 'with a given end (:until option)' do
301
+ expect(channel.favorites_added(until: date).keys.max).to eq date.to_date
302
+ end
303
+
304
+ specify 'with a given start (:from option)' do
305
+ expect(channel.favorites_added(from: date).keys.min).to eq date.to_date
306
+ end
307
+
308
+ specify 'with a given end (:to option)' do
309
+ expect(channel.favorites_added(to: date).keys.max).to eq date.to_date
310
+ end
311
+ end
312
+
313
+ describe 'removed favorites can be retrieved for a specific day' do
314
+ context 'in which the channel was partnered' do
315
+ let(:favorites_removed) { channel.favorites_removed_on 5.days.ago}
316
+ it { expect(favorites_removed).to be_a Float }
317
+ end
318
+
319
+ context 'in which the channel was not partnered' do
320
+ let(:favorites_removed) { channel.favorites_removed_on 20.years.ago}
321
+ it { expect(favorites_removed).to be_nil }
322
+ end
323
+ end
324
+
325
+ describe 'removed favorites can be retrieved for a range of days' do
326
+ let(:date) { 4.days.ago }
327
+
328
+ specify 'with a given start (:since option)' do
329
+ expect(channel.favorites_removed(since: date).keys.min).to eq date.to_date
330
+ end
331
+
332
+ specify 'with a given end (:until option)' do
333
+ expect(channel.favorites_removed(until: date).keys.max).to eq date.to_date
334
+ end
335
+
336
+ specify 'with a given start (:from option)' do
337
+ expect(channel.favorites_removed(from: date).keys.min).to eq date.to_date
338
+ end
339
+
340
+ specify 'with a given end (:to option)' do
341
+ expect(channel.favorites_removed(to: date).keys.max).to eq date.to_date
342
+ end
343
+ end
344
+
281
345
  describe 'estimated minutes watched can be retrieved for a specific day' do
282
346
  context 'in which the channel was partnered' do
283
347
  let(:estimated_minutes_watched) { channel.estimated_minutes_watched_on 5.days.ago}
@@ -269,6 +269,70 @@ describe Yt::Video, :partner do
269
269
  end
270
270
  end
271
271
 
272
+ describe 'added favorites can be retrieved for a specific day' do
273
+ context 'in which the video was partnered' do
274
+ let(:favorites_added) { video.favorites_added_on 5.days.ago}
275
+ it { expect(favorites_added).to be_a Float }
276
+ end
277
+
278
+ context 'in which the video was not partnered' do
279
+ let(:favorites_added) { video.favorites_added_on 20.years.ago}
280
+ it { expect(favorites_added).to be_nil }
281
+ end
282
+ end
283
+
284
+ describe 'added favorites can be retrieved for a range of days' do
285
+ let(:date) { 4.days.ago }
286
+
287
+ specify 'with a given start (:since option)' do
288
+ expect(video.favorites_added(since: date).keys.min).to eq date.to_date
289
+ end
290
+
291
+ specify 'with a given end (:until option)' do
292
+ expect(video.favorites_added(until: date).keys.max).to eq date.to_date
293
+ end
294
+
295
+ specify 'with a given start (:from option)' do
296
+ expect(video.favorites_added(from: date).keys.min).to eq date.to_date
297
+ end
298
+
299
+ specify 'with a given end (:to option)' do
300
+ expect(video.favorites_added(to: date).keys.max).to eq date.to_date
301
+ end
302
+ end
303
+
304
+ describe 'removed favorites can be retrieved for a specific day' do
305
+ context 'in which the video was partnered' do
306
+ let(:favorites_removed) { video.favorites_removed_on 5.days.ago}
307
+ it { expect(favorites_removed).to be_a Float }
308
+ end
309
+
310
+ context 'in which the video was not partnered' do
311
+ let(:favorites_removed) { video.favorites_removed_on 20.years.ago}
312
+ it { expect(favorites_removed).to be_nil }
313
+ end
314
+ end
315
+
316
+ describe 'removed favorites can be retrieved for a range of days' do
317
+ let(:date) { 4.days.ago }
318
+
319
+ specify 'with a given start (:since option)' do
320
+ expect(video.favorites_removed(since: date).keys.min).to eq date.to_date
321
+ end
322
+
323
+ specify 'with a given end (:until option)' do
324
+ expect(video.favorites_removed(until: date).keys.max).to eq date.to_date
325
+ end
326
+
327
+ specify 'with a given start (:from option)' do
328
+ expect(video.favorites_removed(from: date).keys.min).to eq date.to_date
329
+ end
330
+
331
+ specify 'with a given end (:to option)' do
332
+ expect(video.favorites_removed(to: date).keys.max).to eq date.to_date
333
+ end
334
+ end
335
+
272
336
  describe 'impressions can be retrieved for a specific day' do
273
337
  context 'in which the video was partnered' do
274
338
  let(:impressions) { video.impressions_on 20.days.ago}
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.13.11
4
+ version: 0.13.12
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-02-27 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport