fb-core 1.0.0.beta1 → 1.0.0.beta2
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 +4 -0
- data/lib/fb/core/version.rb +1 -1
- data/lib/fb/page.rb +4 -1
- data/lib/fb/post.rb +12 -7
- 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: 789b306e829f04de8f79939da34845bdeda775c1
|
4
|
+
data.tar.gz: 61e889028f90a1ac5bb48ebc9da37dd45cd2b3cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6aab49063ead2f7300477f685154b001390c16b38ff1f13ba3a5b7b665ef5646c5250d4f5f5333550597066d201595ef312cbbd8b4949c77b983f27041130606
|
7
|
+
data.tar.gz: 19f49b576ace99664bcf5cfd20f3dd1bbbb0baeab9255d294e7ed7070e4b2c8c82fae25a8268bbc0765e3403e8e3a9c335083d6f226c05d311035301cd704690
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@ For more information about changelogs, check
|
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
9
|
|
10
|
+
## 1.0.0.beta2 - 2018/03/06
|
11
|
+
|
12
|
+
* [FEATURE] Add `impressions` to `Fb::Post` for number of impressions of a post.
|
13
|
+
|
10
14
|
## 1.0.0.beta1 - 2018/02/14
|
11
15
|
|
12
16
|
* [ENHANCEMENT] Fix and use Page Access Token when request page insights.
|
data/lib/fb/core/version.rb
CHANGED
data/lib/fb/page.rb
CHANGED
@@ -139,8 +139,10 @@ module Fb
|
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
142
|
+
# https://developers.facebook.com/docs/graph-api/reference/v2.10/insights
|
142
143
|
def post_metrics
|
143
|
-
%i(post_engaged_users post_video_views_organic post_video_views_paid post_video_views post_video_view_time
|
144
|
+
%i(post_engaged_users post_video_views_organic post_video_views_paid post_video_views post_video_view_time
|
145
|
+
post_impressions)
|
144
146
|
end
|
145
147
|
|
146
148
|
def videos_with_metrics_from(data)
|
@@ -173,6 +175,7 @@ module Fb
|
|
173
175
|
end
|
174
176
|
end
|
175
177
|
|
178
|
+
# https://developers.facebook.com/docs/graph-api/reference/v2.10/video/video_insights
|
176
179
|
def video_metrics
|
177
180
|
%i(total_video_views total_video_views_unique total_video_avg_time_watched
|
178
181
|
total_video_views_autoplayed total_video_views_clicked_to_play total_video_complete_views_auto_played
|
data/lib/fb/post.rb
CHANGED
@@ -3,7 +3,8 @@
|
|
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
|
6
|
+
# video_views, video_views_organic, video_views_paid, and video_view_time.
|
7
|
+
# @see https://developers.facebook.com/docs/graph-api/reference/v2.10/post
|
7
8
|
class Post
|
8
9
|
|
9
10
|
# @option [String] the post’s unique ID.
|
@@ -39,6 +40,9 @@ module Fb
|
|
39
40
|
# @option [Integer] the total number of milliseconds your video was watched.
|
40
41
|
attr_reader :video_view_time
|
41
42
|
|
43
|
+
# @option [Integer] The number of times your Page's post entered a person's screen.
|
44
|
+
attr_reader :impressions
|
45
|
+
|
42
46
|
# @return [Integer] the number of comments of the post.
|
43
47
|
attr_reader :comment_count
|
44
48
|
|
@@ -55,14 +59,14 @@ module Fb
|
|
55
59
|
# @option [String] :id The post id.
|
56
60
|
# @option [String] :message The status message in the post or post story.
|
57
61
|
# @option [String] :url URL to the permalink page of the post.
|
58
|
-
# @option [String] :
|
62
|
+
# @option [String] :created_at The time the post was initially published.
|
59
63
|
# @option [String] :type A string indicating the object type of this post.
|
60
64
|
# @option [String] :properties of the post (e.g. length).
|
61
|
-
# @option [Integer] :
|
62
|
-
# @option [Integer] :
|
63
|
-
# @option [Integer] :
|
64
|
-
# @option [Integer] :
|
65
|
-
# @option [Integer] :
|
65
|
+
# @option [Integer] :engaged_users The number of people who clicked anywhere on the post.
|
66
|
+
# @option [Integer] :video_views Video views of 3 seconds or more.
|
67
|
+
# @option [Integer] :video_views_organic Organic video views of 3 seconds or more.
|
68
|
+
# @option [Integer] :video_views_paid Paid video views of 3 seconds or more.
|
69
|
+
# @option [Integer] :video_view_time Total video view time (miliseconds).
|
66
70
|
def initialize(options = {})
|
67
71
|
@id = options[:id]
|
68
72
|
@url = options[:permalink_url]
|
@@ -77,6 +81,7 @@ module Fb
|
|
77
81
|
@video_views_organic = options[:post_video_views_organic] if options[:post_video_views_organic]
|
78
82
|
@video_views_paid = options[:post_video_views_paid] if options[:post_video_views_paid]
|
79
83
|
@video_view_time = options[:post_video_view_time] if options[:post_video_view_time]
|
84
|
+
@impressions = options[:post_impressions] if options[:post_impressions]
|
80
85
|
|
81
86
|
@share_count = options[:shares] ? options[:shares]["count"] : 0
|
82
87
|
@comment_count = options[:comments]['summary']['total_count'] if options[:comments]
|
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.beta2
|
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-
|
12
|
+
date: 2018-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fb-support
|