sproutvideo-rb 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -274,7 +274,64 @@ Pass in the id of the access grant you wish to delete.
274
274
  ```ruby
275
275
  Sproutvideo::AccessGrant.delete('asdf1234')
276
276
  ```
277
+ #Analytics
278
+ The following methods are available through the API client for analytics:
277
279
 
280
+ * play_counts
281
+ * domains
282
+ * geo
283
+ * video_types
284
+ * playback types
285
+ * device_types
286
+
287
+ Check the API documentation for more information about the data returned by these calls.
288
+
289
+ Each method can be called on it's own for overall account data for all time like this:
290
+ ```ruby
291
+ Sproutvideo::Analytics.play_counts
292
+ Sproutvideo::Analytics.domains
293
+ SproutVideo::Analytics.geo
294
+ Sproutvideo::Analytics.video_types
295
+ Sproutvideo::Analytics.playback_types
296
+ Sproutvideo::Analytics.device_types
297
+ ```
298
+ Each method can also take an options hash containing a :video_id for retrieving overall data for a specific video:
299
+ ```ruby
300
+ Sproutvideo::Analytics.play_counts(:video_id => 'abc123')
301
+ Sproutvideo::Analytics.domains(:video_id => 'abc123')
302
+ SproutVideo::Analytics.geo(:video_id => 'abc123')
303
+ Sproutvideo::Analytics.video_types(:video_id => 'abc123')
304
+ Sproutvideo::Analytics.playback_types(:video_id => 'abc123')
305
+ Sproutvideo::Analytics.device_types(:video_id => 'abc123')
306
+ ```
307
+ Each method can also take an optional :start_date and :end_date to specify a date range for the returned data:
308
+ ```ruby
309
+ Sproutvideo::Analytics.play_counts(:start_date => '2013-01-01')
310
+ Sproutvideo::Analytics.device_types(:video_id => 'abc123', :end_date => '2012-12-31')
311
+ ```
312
+
313
+ Lastly, the geo method can take an optional :country to retrieve playback data by city within that country
314
+ ```ruby
315
+ Sproutvideo::Analytics.geo(:video_id => 'abc123', :country => 'US')
316
+ ```
317
+
318
+ #Engagement
319
+ You can grab the total number of seconds of your videos that have been watched like this:
320
+ ```ruby
321
+ Sproutvideo::Analytics.engagement
322
+ ```
323
+
324
+ You can grab engagement for a specific video like so:
325
+ ```ruby
326
+ Sproutvideo::Analytics.engagement(:video_id => 'abc123')
327
+ ```
328
+
329
+ Lastly, you can grab every single playback session for a video like this:
330
+ ```ruby
331
+ Sproutvideo::Analytics.engagement_sessions('abc123')
332
+ Sproutvideo::Analytics.engagement_sessions('abc123', :page => 3)
333
+ Sproutvideo::Analytics.engagement_sessions('abc123', :page => 3, :per_page => 40)
334
+ ```
278
335
  # Contributing to sproutvideo-rb
279
336
 
280
337
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
data/lib/sproutvideo.rb CHANGED
@@ -9,4 +9,5 @@ require 'sproutvideo/video.rb'
9
9
  require 'sproutvideo/tag.rb'
10
10
  require 'sproutvideo/playlist.rb'
11
11
  require 'sproutvideo/login.rb'
12
- require 'sproutvideo/access_grant.rb'
12
+ require 'sproutvideo/access_grant.rb'
13
+ require 'sproutvideo/analytics.rb'
@@ -1,3 +1,3 @@
1
1
  module Sproutvideo
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sproutvideo-rb}
8
- s.version = "1.1.1"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["SproutVideo"]
12
- s.date = %q{2012-12-12}
12
+ s.date = %q{2013-01-08}
13
13
  s.description = %q{SproutVideo API Client}
14
14
  s.email = %q{support@sproutvideo.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 1
7
- - 1
8
- - 1
9
- version: 1.1.1
7
+ - 2
8
+ - 0
9
+ version: 1.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - SproutVideo
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-12-12 00:00:00 -05:00
17
+ date: 2013-01-08 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency