fb-core 1.0.0.beta5 → 1.0.0.beta6
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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/fb/core/version.rb +1 -1
- data/lib/fb/page.rb +5 -1
- data/lib/fb/video.rb +35 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4751bfa02cb3f296dfbc31247795e1c1d33546f
|
4
|
+
data.tar.gz: 0e1354c44234f1143b7262713a76e179b85842da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a0a5c1d6ca774f9d089ad5fd5aeb80404e1de97488c6bb14cfb589d83b9e1f3151f17e423b6b4ed635013fb77fde7ad319953157ca4cbf7407e6a970b179a0
|
7
|
+
data.tar.gz: 40a201c4bc36570e1b3ec6f6ac25a90cf85462f400b8efd48fceea82277f91ecf07aeacf834f354025051455e49feb0816efcf58502c45c357ade146056cfdf3
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
data/lib/fb/core/version.rb
CHANGED
data/lib/fb/page.rb
CHANGED
@@ -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
|
data/lib/fb/video.rb
CHANGED
@@ -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]) :
|
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]) :
|
83
|
-
@ad_breaks = options[:ad_breaks] ? Array(options[:ad_breaks]) :
|
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
|
-
|
88
|
-
@
|
89
|
-
@
|
90
|
-
@
|
91
|
-
@
|
92
|
-
@
|
93
|
-
@
|
94
|
-
@
|
95
|
-
@
|
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.
|
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-
|
12
|
+
date: 2018-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fb-support
|