fb-core 1.0.0.beta7 → 1.0.0.beta8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d853e976631a35311183b0d8f28bae65b4d90cc
4
- data.tar.gz: a32067114ea8e9ccaf76b2a9cf7333bc8d0d1282
3
+ metadata.gz: 62b3639b2d53365cf9fcf89ac1520aad9bed5e2b
4
+ data.tar.gz: 8348719c7b2f4f12ecf4622b5888dd106a0d1d29
5
5
  SHA512:
6
- metadata.gz: 1c9bb54f6c5790fd0fcdc1aa14192c0aec44d91450f66a938fb3391d366bb982c10a04ede5f502757d0f0248a07bc583935a559e82aadcf14313797696647d9d
7
- data.tar.gz: a9cd5b24460099063284245405a713d360ea8400729613631e9cefa19f93f3e8c8e8d8260e6648e2176422e01312aa518983f991194f0800c3775828179d45be
6
+ metadata.gz: db7576ae42ffbb4fb4c068372f687212605b049971925dae88e710f7a1218ca3c9eb8106f69dc769ee5188b870149bf15b8e4ede228180b1c86853ed7b4921af
7
+ data.tar.gz: 4ff564d72a423c75cf5984c0da7dd75ede0ae6204e65517f57fdf25523974df155a710e403c91c50bd97cfe7d7e889b36a48a861cb60407db1daa86a438566db
data/CHANGELOG.md CHANGED
@@ -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
+ ## 1.0.0.beta8 - 2018/04/20
10
+
11
+ * [FEATURE] Add `consumptions`, `engaged_fan`, `fan_reach` and many more metrics to `Fb::Post`.
12
+
9
13
  ## 1.0.0.beta7 - 2018/04/09
10
14
 
11
15
  **How to upgrade**
@@ -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.beta7'
6
+ VERSION = '1.0.0.beta8'
7
7
  end
8
8
  end
data/lib/fb/page.rb CHANGED
@@ -153,8 +153,24 @@ module Fb
153
153
 
154
154
  # https://developers.facebook.com/docs/graph-api/reference/v2.10/insights
155
155
  def post_metrics
156
- %i(post_engaged_users post_video_views_organic post_video_views_paid post_video_views post_video_view_time
157
- post_impressions post_video_avg_time_watched)
156
+ %i(post_video_complete_views_30s_autoplayed post_video_complete_views_30s_clicked_to_play
157
+ post_video_complete_views_30s_organic post_video_complete_views_30s_paid
158
+ post_video_complete_views_30s_unique post_impressions post_impressions_unique
159
+ post_impressions_paid post_impressions_paid_unique post_impressions_fan
160
+ post_impressions_fan_unique post_impressions_fan_paid post_impressions_fan_paid_unique
161
+ post_impressions_organic post_impressions_organic_unique post_impressions_viral
162
+ post_consumptions post_engaged_users post_negative_feedback post_engaged_fan
163
+ post_fan_reach post_reactions_like_total post_reactions_love_total
164
+ post_reactions_wow_total post_reactions_haha_total post_reactions_sorry_total
165
+ post_reactions_anger_total post_video_avg_time_watched post_video_complete_views_organic
166
+ post_video_complete_views_organic_unique post_video_complete_views_paid
167
+ post_video_complete_views_paid_unique post_video_views_organic
168
+ post_video_views_organic_unique post_video_views_paid post_video_views_paid_unique
169
+ post_video_length post_video_views post_video_views_unique post_video_views_autoplayed
170
+ post_video_views_clicked_to_play post_video_views_10s post_video_views_10s_unique
171
+ post_video_views_10s_autoplayed post_video_views_10s_clicked_to_play
172
+ post_video_views_10s_organic post_video_views_10s_paid post_video_views_10s_sound_on
173
+ post_video_views_sound_on post_video_view_time post_video_view_time_organic)
158
174
  end
159
175
 
160
176
  def videos_with_metrics_from(data)
data/lib/fb/post.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Fb
4
4
  # Fb::Post reprensents a Facebook post. Post provides getters for:
5
5
  # :id, :url, :created_at, :type, :message, :length, engaged_users,
6
- # video_views, video_views_organic, video_views_paid, and video_view_time.
6
+ # video_views, video_views_organic, video_views_paid, and so on.
7
7
  # @see https://developers.facebook.com/docs/graph-api/reference/v2.10/post
8
8
  class Post
9
9
 
@@ -25,39 +25,200 @@ module Fb
25
25
  # @option [String] the attached video's length or n/a.
26
26
  attr_reader :length
27
27
 
28
+ # @return [Integer] the number of comments of the post.
29
+ attr_reader :comment_count
30
+
31
+ # @return [Integer] the number of likes of the post.
32
+ attr_reader :like_count
33
+
34
+ # @return [Integer] the number of reactions of the post.
35
+ attr_reader :reaction_count
36
+
37
+ # @return [Integer] the number of shares of the post.
38
+ attr_reader :share_count
39
+
40
+ # @option [Integer] number of times your video started automatically playing
41
+ # and people viewed it for 30 seconds or to the end, whichever came first.
42
+ attr_reader :video_complete_views_30s_autoplayed
43
+
44
+ # @option [Integer] number of times people clicked to play your video and
45
+ # viewed it for 30 seconds or to the end, whichever came first.
46
+ attr_reader :video_complete_views_30s_clicked_to_play
47
+
48
+ # @option [Integer] number of times your video was viewed for 30 seconds
49
+ # or viewed to the end, whichever came first, without a paid promotion.
50
+ attr_reader :video_complete_views_30s_organic
51
+
52
+ # @option [Integer] number of times your video was viewed for 30 seconds or
53
+ # viewed to the end, whichever came first, after a paid promotion.
54
+ attr_reader :video_complete_views_30s_paid
55
+
56
+ # @option [Integer] total number of times page's videos have been viewed
57
+ # for more than 30 seconds by unique users.
58
+ attr_reader :video_complete_views_30s_unique
59
+
60
+ # @option [Integer] the number of times your Page's post entered a person's screen.
61
+ attr_reader :impressions
62
+
63
+ # @option [Integer] the number of people who had your Page's post enter
64
+ # their screen.
65
+ attr_reader :impressions_unique
66
+
67
+ # @option [Integer] the number of times your Page's post entered a person's
68
+ # screen through paid distribution such as an ad.
69
+ attr_reader :impressions_paid
70
+
71
+ # @option [Integer] the number of people who had your Page's post enter
72
+ # their screen through paid distribution such as an ad.
73
+ attr_reader :impressions_paid_unique
74
+
75
+ # @option [Integer] the number of impressions for your Page post by people
76
+ # who have liked your Page.
77
+ attr_reader :impressions_fan
78
+
79
+ # @option [Integer] the number of people who have like your Page who saw your Page post.
80
+ attr_reader :impressions_fan_unique
81
+
82
+ # @option [Integer] the number of impressions for your Page post by people
83
+ # who like your Page in an Ad or Sponsored Story.
84
+ attr_reader :impressions_fan_paid
85
+
86
+ # @option [Integer] the number of people who have like your Page and saw
87
+ # your Page post in an Ad or Sponsored Story.
88
+ attr_reader :impressions_fan_paid_unique
89
+
90
+ # @option [Integer] the number of times your Page's post entered a person's screen.
91
+ attr_reader :impressions_organic
92
+
93
+ # @option [Integer] the number of people who had your Page's post enter their screen.
94
+ attr_reader :impressions_organic_unique
95
+
96
+ # @option [Integer] the number of times your Page's post entered a person's
97
+ # screen with social information attached.
98
+ attr_reader :impressions_viral
99
+
100
+ # @option [Integer] the number of times people clicked on anywhere
101
+ # in your posts without generating a story.
102
+ attr_reader :consumptions
103
+
28
104
  # @option [Integer] the number of people who clicked anywhere on the post.
29
105
  attr_reader :engaged_users
30
106
 
31
- # @option [Integer] video views of 3 seconds or more.
32
- attr_reader :video_views
107
+ # @option [Integer] the number of times people took a negative action in your post (e.g. hid it).
108
+ attr_reader :negative_feedback
109
+
110
+ # @option [Integer] people who have liked your page and engaged with your post.
111
+ attr_reader :engaged_fan
112
+
113
+ # @option [Integer] post reach by people who like your page.
114
+ attr_reader :fan_reach
115
+
116
+ # @option [Integer] total "like" reactions of a post.
117
+ attr_reader :reactions_like_total
118
+
119
+ # @option [Integer] total "love" reactions of a post.
120
+ attr_reader :reactions_love_total
121
+
122
+ # @option [Integer] total "wow" reactions of a post.
123
+ attr_reader :reactions_wow_total
124
+
125
+ # @option [Integer] total "haha" reactions of a post.
126
+ attr_reader :reactions_haha_total
127
+
128
+ # @option [Integer] total "sorry" reactions of a post.
129
+ attr_reader :reactions_sorry_total
130
+
131
+ # @option [Integer] total "anger" reactions of a post.
132
+ attr_reader :reactions_anger_total
133
+
134
+ # @option [Integer] the average length of time people spent viewing
135
+ # your video, in milliseconds.
136
+ attr_reader :video_avg_time_watched
137
+
138
+ # @option [Integer] the number of times your video was organically viewed
139
+ # from the beginning to 95% of its length.
140
+ attr_reader :video_complete_views_organic
141
+
142
+ # @option [Integer] the number of people who viewed your video organically
143
+ # from the beginning to 95% of its length.
144
+ attr_reader :video_complete_views_organic_unique
145
+
146
+ # @option [Integer] the number of times your video was viewed via paid
147
+ # impression from the beginning to 95% of its length.
148
+ attr_reader :video_complete_views_paid
149
+
150
+ # @option [Integer] the number of people who viewed your video via
151
+ # paid impression from the beginning to 95% of its length.
152
+ attr_reader :video_complete_views_paid_unique
33
153
 
34
154
  # @option [Integer] organic video views of 3 seconds or more.
35
155
  attr_reader :video_views_organic
36
156
 
157
+ # @option [Integer] the number of people who viewed at least 3 seconds
158
+ # of your video organically.
159
+ attr_reader :video_views_organic_unique
160
+
37
161
  # @option [Integer] paid video views of 3 seconds or more.
38
162
  attr_reader :video_views_paid
39
163
 
40
- # @option [Integer] the total number of milliseconds your video was watched.
41
- attr_reader :video_view_time
164
+ # @option [Integer] the number of people who viewed at least 3 seconds
165
+ # of your video via paid impression.
166
+ attr_reader :video_views_paid_unique
42
167
 
43
- # @option [Integer] The number of times your Page's post entered a person's screen.
44
- attr_reader :impressions
168
+ # @option [Integer] length of a video post (in milliseconds).
169
+ attr_reader :video_length
45
170
 
46
- # @option [Integer] The average length of time people spent viewing
47
- # your video, in milliseconds.
48
- attr_reader :video_avg_time_watched
171
+ # @option [Integer] video views of 3 seconds or more.
172
+ attr_reader :video_views
49
173
 
50
- # @return [Integer] the number of comments of the post.
51
- attr_reader :comment_count
174
+ # @option [Integer] the number of distinct people who viewed your video at least once.
175
+ attr_reader :video_views_unique
52
176
 
53
- # @return [Integer] the number of likes of the post.
54
- attr_reader :like_count
177
+ # @option [Integer] number of times your video started automatically
178
+ # playing and people viewed it for more than 3 seconds.
179
+ attr_reader :video_views_autoplayed
55
180
 
56
- # @return [Integer] the number of reactions of the post.
57
- attr_reader :reaction_count
181
+ # @option [Integer] number of times people clicked to play your video
182
+ # and viewed it more than 3 seconds.
183
+ attr_reader :video_views_clicked_to_play
58
184
 
59
- # @return [Integer] the number of shares of the post.
60
- attr_reader :share_count
185
+ # @option [Integer] the number of times your video was watched for an aggregate of
186
+ # at least 10 seconds, or for nearly its total length, whichever happened first.
187
+ attr_reader :video_views_10s
188
+
189
+ # @option [Integer] number of unique viewers who watched your video for
190
+ # 10 seconds or to the end, whichever happened first.
191
+ attr_reader :video_views_10s_unique
192
+
193
+ # @option [Integer] number of times your video started playing automatically
194
+ # and people viewed it for 10 seconds or to the end, whichever happened first.
195
+ attr_reader :video_views_10s_autoplayed
196
+
197
+ # @option [Integer] number of times people clicked to play your video and
198
+ # viewed it for 10 seconds or to the end, whichever happened first.
199
+ attr_reader :video_views_10s_clicked_to_play
200
+
201
+ # @option [Integer] number of times your video was viewed for 10 seconds or
202
+ # viewed to the end (whichever happened first) without paid promotion.
203
+ attr_reader :video_views_10s_organic
204
+
205
+ # @option [Integer] number of times your video was viewed for 10 seconds or
206
+ # viewed to the end (whichever happened first) with paid promotion.
207
+ attr_reader :video_views_10s_paid
208
+
209
+ # @option [Integer] number of times your video was viewed with sound on
210
+ # for 10 seconds or viewed to the end, whichever happened first.
211
+ attr_reader :video_views_10s_sound_on
212
+
213
+ # @option [Integer] number of times your video was viewed with sound on
214
+ # for 3 seconds or viewed to the end, whichever happened first.
215
+ attr_reader :video_views_sound_on
216
+
217
+ # @option [Integer] the total number of milliseconds your video was watched.
218
+ attr_reader :video_view_time
219
+
220
+ # @option [Integer] total time (in milliseconds) video has been viewed without paid promotion.
221
+ attr_reader :video_view_time_organic
61
222
 
62
223
  # @param [Hash] options the options to initialize an instance of Fb::Post.
63
224
  # @option [String] :id The post id.
@@ -80,18 +241,62 @@ module Fb
80
241
  @length = options.fetch(:properties, []).find(-> { {'text' => 'n/a'} }) do |property|
81
242
  property['name'] == 'Length'
82
243
  end['text']
83
- @engaged_users = options[:post_engaged_users]
84
- @video_views = options[:post_video_views]
85
- @video_views_organic = options[:post_video_views_organic]
86
- @video_views_paid = options[:post_video_views_paid]
87
- @video_view_time = options[:post_video_view_time]
88
- @impressions = options[:post_impressions]
89
- @video_avg_time_watched = options[:post_video_avg_time_watched]
90
-
91
244
  @share_count = options[:shares] ? options[:shares]["count"] : 0
92
245
  @comment_count = options[:comments]['summary']['total_count'] if options[:comments]
93
246
  @reaction_count = options[:reactions]['summary']['total_count'] if options[:reactions]
94
247
  @like_count = options[:likes]['summary']['total_count'] if options[:likes]
248
+
249
+ @video_complete_views_30s_autoplayed = options[:post_video_complete_views_30s_autoplayed]
250
+ @video_complete_views_30s_clicked_to_play = options[:post_video_complete_views_30s_clicked_to_play]
251
+ @video_complete_views_30s_organic = options[:post_video_complete_views_30s_organic]
252
+ @video_complete_views_30s_paid = options[:post_video_complete_views_30s_paid]
253
+ @video_complete_views_30s_unique = options[:post_video_complete_views_30s_unique]
254
+ @impressions = options[:post_impressions]
255
+ @impressions_unique = options[:post_impressions_unique]
256
+ @impressions_paid = options[:post_impressions_paid]
257
+ @impressions_paid_unique = options[:post_impressions_paid_unique]
258
+ @impressions_fan = options[:post_impressions_fan]
259
+ @impressions_fan_unique = options[:post_impressions_fan_unique]
260
+ @impressions_fan_paid = options[:post_impressions_fan_paid]
261
+ @impressions_fan_paid_unique = options[:post_impressions_fan_paid_unique]
262
+ @impressions_organic = options[:post_impressions_organic]
263
+ @impressions_organic_unique = options[:post_impressions_organic_unique]
264
+ @impressions_viral = options[:post_impressions_viral]
265
+ @consumptions = options[:post_consumptions]
266
+ @engaged_users = options[:post_engaged_users]
267
+ @negative_feedback = options[:post_negative_feedback]
268
+ @engaged_fan = options[:post_engaged_fan]
269
+ @fan_reach = options[:post_fan_reach]
270
+ @reactions_like_total = options[:post_reactions_like_total]
271
+ @reactions_love_total = options[:post_reactions_love_total]
272
+ @reactions_wow_total = options[:post_reactions_wow_total]
273
+ @reactions_haha_total = options[:post_reactions_haha_total]
274
+ @reactions_sorry_total = options[:post_reactions_sorry_total]
275
+ @reactions_anger_total = options[:post_reactions_anger_total]
276
+ @video_avg_time_watched = options[:post_video_avg_time_watched]
277
+ @video_complete_views_organic = options[:post_video_complete_views_organic]
278
+ @video_complete_views_organic_unique = options[:post_video_complete_views_organic_unique]
279
+ @video_complete_views_paid = options[:post_video_complete_views_paid]
280
+ @video_complete_views_paid_unique = options[:post_video_complete_views_paid_unique]
281
+ @video_views_organic = options[:post_video_views_organic]
282
+ @video_views_organic_unique = options[:post_video_views_organic_unique]
283
+ @video_views_paid = options[:post_video_views_paid]
284
+ @video_views_paid_unique = options[:post_video_views_paid_unique]
285
+ @video_length = options[:post_video_length]
286
+ @video_views = options[:post_video_views]
287
+ @video_views_unique = options[:post_video_views_unique]
288
+ @video_views_autoplayed = options[:post_video_views_autoplayed]
289
+ @video_views_clicked_to_play = options[:post_video_views_clicked_to_play]
290
+ @video_views_10s = options[:post_video_views_10s]
291
+ @video_views_10s_unique = options[:post_video_views_10s_unique]
292
+ @video_views_10s_autoplayed = options[:post_video_views_10s_autoplayed]
293
+ @video_views_10s_clicked_to_play = options[:post_video_views_10s_clicked_to_play]
294
+ @video_views_10s_organic = options[:post_video_views_10s_organic]
295
+ @video_views_10s_paid = options[:post_video_views_10s_paid]
296
+ @video_views_10s_sound_on = options[:post_video_views_10s_sound_on]
297
+ @video_views_sound_on = options[:post_video_views_sound_on]
298
+ @video_view_time = options[:post_video_view_time]
299
+ @video_view_time_organic = options[:post_video_view_time_organic]
95
300
  end
96
301
 
97
302
  # @return [String] the representation of the post.
data/lib/fb/video.rb CHANGED
@@ -36,51 +36,51 @@ module Fb
36
36
  # @option [Float] the video’s length.
37
37
  attr_reader :length
38
38
 
39
- # @option [Time] The time the video was initially published.
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.
42
+ # @option [Time] the time when the video post was created.
43
43
  attr_reader :backdated_time
44
44
 
45
- # @option [Integer] Total number of times the video was viewed for 3 seconds
45
+ # @option [Integer] total number of times the video was viewed for 3 seconds
46
46
  # or viewed to the end, whichever happened first. total_video_views.
47
47
  # @see https://developers.facebook.com/docs/graph-api/reference/video/video_insights/
48
48
  attr_reader :total_views
49
49
 
50
- # @option [Integer] The total_video_views_unique of the video.
50
+ # @option [Integer] the total_video_views_unique of the video.
51
51
  attr_reader :total_views_unique
52
52
 
53
- # @option [Integer] The total_video_avg_time_watched of the video.
53
+ # @option [Integer] the total_video_avg_time_watched of the video.
54
54
  attr_reader :total_avg_time_watched
55
55
 
56
- # @option [Integer] The total_video_views_autoplayed of the video.
56
+ # @option [Integer] the total_video_views_autoplayed of the video.
57
57
  attr_reader :total_views_autoplayed
58
58
 
59
- # @option [Integer] The total_video_views_clicked_to_play of the video.
59
+ # @option [Integer] the total_video_views_clicked_to_play of the video.
60
60
  attr_reader :total_views_clicked_to_play
61
61
 
62
- # @option [Integer] The total_video_complete_views_auto_played of the video.
62
+ # @option [Integer] the total_video_complete_views_auto_played of the video.
63
63
  attr_reader :total_complete_views_auto_played
64
64
 
65
- # @option [Integer] The total_video_complete_views_clicked_to_play of the video.
65
+ # @option [Integer] the total_video_complete_views_clicked_to_play of the video.
66
66
  attr_reader :total_complete_views_clicked_to_play
67
67
 
68
- # @option [Integer] The total_video_views_sound_on of the video.
68
+ # @option [Integer] the total_video_views_sound_on of the video.
69
69
  attr_reader :total_views_sound_on
70
70
 
71
- # @option [Integer] The total_video_10s_views_auto_played of the video.
71
+ # @option [Integer] the total_video_10s_views_auto_played of the video.
72
72
  attr_reader :total_10s_views_sound_on
73
73
 
74
- # @option [Integer] The number of impressions of the video.
74
+ # @option [Integer] the number of impressions of the video.
75
75
  attr_reader :total_impressions
76
76
 
77
- # @option [Integer] Number of people your video was served to.
77
+ # @option [Integer] number of people your video was served to.
78
78
  attr_reader :total_impressions_unique
79
79
 
80
- # @option [Integer] Number of times your video was viewed for 95% or complete.
80
+ # @option [Integer] number of times your video was viewed for 95% or complete.
81
81
  attr_reader :total_complete_views
82
82
 
83
- # @option [Integer] Number of unique viewers who watched for 95% or complete.
83
+ # @option [Integer] number of unique viewers who watched for 95% or complete.
84
84
  attr_reader :total_complete_views_unique
85
85
 
86
86
  # @param [Hash] options the options to initialize an instance of Fb::Video.
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.beta7
4
+ version: 1.0.0.beta8
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-10 00:00:00.000000000 Z
12
+ date: 2018-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fb-support