fb-core 1.0.0.beta5 → 1.0.0.beta6

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: e7e71213514901eeee3998f6f55da6f1b4d46051
4
- data.tar.gz: b56d90ee3ae5a12098752bc06641392a922a80d6
3
+ metadata.gz: d4751bfa02cb3f296dfbc31247795e1c1d33546f
4
+ data.tar.gz: 0e1354c44234f1143b7262713a76e179b85842da
5
5
  SHA512:
6
- metadata.gz: d65ac5919a1f3e674e2510e600c340238e88e6bf5a463c65549dc9283c1c97191cdeb92a9e7c4ad952cb7b14ff0540092f8de16f5e5b7f27d33c57dd6edb4e16
7
- data.tar.gz: '098c609e56e3b2e897581e03fbdcb2f4ca9e3de67c6bbfd1d6e53373a333c93224e5c8be1477d4bde1bfea997b8cb0cc16a04353c795c7ab16eaab7d6155a611'
6
+ metadata.gz: d7a0a5c1d6ca774f9d089ad5fd5aeb80404e1de97488c6bb14cfb589d83b9e1f3151f17e423b6b4ed635013fb77fde7ad319953157ca4cbf7407e6a970b179a0
7
+ data.tar.gz: 40a201c4bc36570e1b3ec6f6ac25a90cf85462f400b8efd48fceea82277f91ecf07aeacf834f354025051455e49feb0816efcf58502c45c357ade146056cfdf3
@@ -6,6 +6,11 @@ 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
+ ## 1.0.0.beta6 - 2018/04/05
10
+
11
+ * [FEATURE] Add `backdated_time`, `total_impressions`, `total_impressions_unique`,
12
+ `total_complete_views` and `total_complete_views_unique` to `Fb::Video`.
13
+
9
14
  ## 1.0.0.beta5 - 2018/03/29
10
15
 
11
16
  * [REMOVAL] Remove `Fb::Page#insights_with_date_range` method.
@@ -3,6 +3,6 @@ module Fb
3
3
  class Core
4
4
  # @return [String] the SemVer-compatible gem version.
5
5
  # @see http://semver.org
6
- VERSION = '1.0.0.beta5'
6
+ VERSION = '1.0.0.beta6'
7
7
  end
8
8
  end
@@ -141,6 +141,7 @@ module Fb
141
141
  request.run.body
142
142
  end
143
143
 
144
+ # https://developers.facebook.com/docs/graph-api/reference/v2.10/post
144
145
  def posts_params
145
146
  {}.tap do |params|
146
147
  params[:access_token] = @access_token
@@ -175,11 +176,12 @@ module Fb
175
176
  request.run.body
176
177
  end
177
178
 
179
+ # https://developers.facebook.com/docs/graph-api/reference/v2.10/video
178
180
  def video_params
179
181
  {}.tap do |params|
180
182
  params[:access_token] = @access_token
181
183
  params[:limit] = 25
182
- params[:fields] = ['id', 'permalink_url', 'custom_labels', 'title',
184
+ params[:fields] = ['id', 'permalink_url', 'custom_labels', 'title', 'backdated_time',
183
185
  'length', 'content_tags', 'likes.limit(0).summary(true)', 'comments.limit(0).summary(true)',
184
186
  'created_time', 'ad_breaks', 'description', 'reactions.limit(0).summary(true)'
185
187
  ].join(',')
@@ -189,6 +191,8 @@ module Fb
189
191
  # https://developers.facebook.com/docs/graph-api/reference/v2.10/video/video_insights
190
192
  def video_metrics
191
193
  %i(total_video_views total_video_views_unique total_video_avg_time_watched
194
+ total_video_impressions total_video_impressions_unique
195
+ total_video_complete_views total_video_complete_views_unique
192
196
  total_video_views_autoplayed total_video_views_clicked_to_play total_video_complete_views_auto_played
193
197
  total_video_complete_views_clicked_to_play total_video_views_sound_on total_video_10s_views_sound_on)
194
198
  end
@@ -39,6 +39,9 @@ module Fb
39
39
  # @option [Time] The time the video was initially published.
40
40
  attr_reader :created_at
41
41
 
42
+ # @option [Time] The time when the video post was created.
43
+ attr_reader :backdated_time
44
+
42
45
  # @option [Integer] Total number of times the video was viewed for 3 seconds
43
46
  # or viewed to the end, whichever happened first. total_video_views.
44
47
  # @see https://developers.facebook.com/docs/graph-api/reference/video/video_insights/
@@ -68,31 +71,49 @@ module Fb
68
71
  # @option [Integer] The total_video_10s_views_auto_played of the video.
69
72
  attr_reader :total_10s_views_sound_on
70
73
 
74
+ # @option [Integer] The number of impressions of the video.
75
+ attr_reader :total_impressions
76
+
77
+ # @option [Integer] Number of people your video was served to.
78
+ attr_reader :total_impressions_unique
79
+
80
+ # @option [Integer] Number of times your video was viewed for 95% or complete.
81
+ attr_reader :total_complete_views
82
+
83
+ # @option [Integer] Number of unique viewers who watched for 95% or complete.
84
+ attr_reader :total_complete_views_unique
85
+
71
86
  # @param [Hash] options the options to initialize an instance of Fb::Video.
72
87
  def initialize(options = {})
73
88
  @id = options[:id]
74
89
  @url = options[:permalink_url]
75
90
  @title = options[:title]
76
91
  @description = options[:description]
77
- @custom_labels = options[:custom_labels] ? Array(options[:custom_labels]) : Array.new
92
+ @custom_labels = options[:custom_labels] ? Array(options[:custom_labels]) : []
78
93
 
79
94
  @comment_count = options[:comments]['summary']['total_count'] if options[:comments]
80
95
  @like_count = options[:likes]['summary']['total_count'] if options[:likes]
81
96
  @reaction_count = options[:reactions]['summary']['total_count'] if options[:reactions]
82
- @content_tags = options[:content_tags] ? Array(options[:content_tags]) : Array.new
83
- @ad_breaks = options[:ad_breaks] ? Array(options[:ad_breaks]) : Array.new
97
+ @content_tags = options[:content_tags] ? Array(options[:content_tags]) : []
98
+ @ad_breaks = options[:ad_breaks] ? Array(options[:ad_breaks]) : []
84
99
  @length = options[:length]
85
- @created_at = Time.strptime(options[:created_time], '%Y-%m-%dT%H:%M:%S+0000')
86
-
87
- @total_views = options[:total_video_views] if options[:total_video_views]
88
- @total_views_unique = options[:total_video_views_unique] if options[:total_video_views_unique]
89
- @total_avg_time_watched = options[:total_video_avg_time_watched] if options[:total_video_avg_time_watched]
90
- @total_views_autoplayed = options[:total_video_views_autoplayed] if options[:total_video_views_autoplayed]
91
- @total_views_clicked_to_play = options[:total_video_views_clicked_to_play] if options[:total_video_views_clicked_to_play]
92
- @total_complete_views_auto_played = options[:total_video_complete_views_auto_played] if options[:total_video_complete_views_auto_played]
93
- @total_complete_views_clicked_to_play = options[:total_video_complete_views_clicked_to_play] if options[:total_video_complete_views_clicked_to_play]
94
- @total_views_sound_on = options[:total_video_views_sound_on] if options[:total_video_views_sound_on]
95
- @total_10s_views_sound_on = options[:total_video_10s_views_sound_on] if options[:total_video_10s_views_sound_on]
100
+ @created_at = Time.strptime(options[:created_time], '%Y-%m-%dT%H:%M:%S+0000') if options[:created_time]
101
+ @backdated_time = Time.strptime(options[:backdated_time], '%Y-%m-%dT%H:%M:%S+0000') if options[:backdated_time]
102
+
103
+ @total_views = options[:total_video_views]
104
+ @total_views_unique = options[:total_video_views_unique]
105
+ @total_avg_time_watched = options[:total_video_avg_time_watched]
106
+ @total_views_autoplayed = options[:total_video_views_autoplayed]
107
+ @total_views_clicked_to_play = options[:total_video_views_clicked_to_play]
108
+ @total_complete_views_auto_played = options[:total_video_complete_views_auto_played]
109
+ @total_complete_views_clicked_to_play = options[:total_video_complete_views_clicked_to_play]
110
+ @total_views_sound_on = options[:total_video_views_sound_on]
111
+ @total_10s_views_sound_on = options[:total_video_10s_views_sound_on]
112
+
113
+ @total_impressions = options[:total_video_impressions]
114
+ @total_impressions_unique = options[:total_video_impressions_unique]
115
+ @total_complete_views = options[:total_video_complete_views]
116
+ @total_complete_views_unique = options[:total_video_complete_views_unique]
96
117
  end
97
118
 
98
119
  # @return [String] the representation of the post.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta5
4
+ version: 1.0.0.beta6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Baccigalupo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-04-03 00:00:00.000000000 Z
12
+ date: 2018-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fb-support