Skip to content

Commit

Permalink
Merge d615e37 into 32f8307
Browse files Browse the repository at this point in the history
  • Loading branch information
kangkyu committed Aug 13, 2018
2 parents 32f8307 + d615e37 commit 8cd2a2a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,25 @@ For more information about changelogs, check
[Vandamme](http://tech-angels.github.io/vandamme).


## 1.0.0 - Unreleased
## 1.0.0.beta11

* [IMPROVEMENT] Return UTC time for String value of `created_time`, `backdated_time`,
`end_time`, etc from Facebook to have exact time.
* [FEATURE] Add `Fb::Post#lifetime_insights` method to get metrics of each post.
* [BUGFIX] Return empty hash instead of nil when a metric returns empty array.

**How to upgrade**

If your code calls `.consumptions` then you must replace that code with `.clicks`
since those metrics will no longer be supported by Facebook API as of
[August 1, 2018](https://developers.facebook.com/docs/graph-api/reference/v2.9/insights#newnames).
If your code calls `fan_reach` from a Fb::Post then you must remove that code
because Facebook removed that metric from their API silently.

* [REMOVAL] Remove `#consumptions` method for posts
* [REMOVAL] Remove `#fan_reach` method for posts
* [FEATURE] Add `#clicks` method for posts

## 1.0.0.beta10 - 2018/05/01

* [FEATURE] Add `:since` and `:until` option to `Page#videos` method.
Expand Down
2 changes: 1 addition & 1 deletion lib/fb/core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module Fb
class Core
# @return [String] the SemVer-compatible gem version.
# @see http://semver.org
VERSION = '1.0.0.beta10'
VERSION = '1.0.0.beta11'
end
end
4 changes: 2 additions & 2 deletions lib/fb/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ def post_metrics
post_impressions_paid post_impressions_paid_unique post_impressions_fan
post_impressions_fan_unique post_impressions_fan_paid post_impressions_fan_paid_unique
post_impressions_organic post_impressions_organic_unique post_impressions_viral
post_consumptions post_engaged_users post_negative_feedback post_engaged_fan
post_fan_reach post_reactions_like_total post_reactions_love_total
post_clicks post_engaged_users post_negative_feedback post_engaged_fan
post_reactions_like_total post_reactions_love_total
post_reactions_wow_total post_reactions_haha_total post_reactions_sorry_total
post_reactions_anger_total post_video_avg_time_watched post_video_complete_views_organic
post_video_complete_views_organic_unique post_video_complete_views_paid
Expand Down
8 changes: 2 additions & 6 deletions lib/fb/post.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Post < Resource

# @option [Integer] the number of times people clicked on anywhere
# in your posts without generating a story.
attr_reader :consumptions
attr_reader :clicks

# @option [Integer] the number of people who clicked anywhere on the post.
attr_reader :engaged_users
Expand All @@ -111,9 +111,6 @@ class Post < Resource
# @option [Integer] people who have liked your page and engaged with your post.
attr_reader :engaged_fan

# @option [Integer] post reach by people who like your page.
attr_reader :fan_reach

# @option [Integer] total "like" reactions of a post.
attr_reader :reactions_like_total

Expand Down Expand Up @@ -263,11 +260,10 @@ def initialize(options = {})
@impressions_organic = options[:post_impressions_organic]
@impressions_organic_unique = options[:post_impressions_organic_unique]
@impressions_viral = options[:post_impressions_viral]
@consumptions = options[:post_consumptions]
@clicks = options[:post_clicks]
@engaged_users = options[:post_engaged_users]
@negative_feedback = options[:post_negative_feedback]
@engaged_fan = options[:post_engaged_fan]
@fan_reach = options[:post_fan_reach]
@reactions_like_total = options[:post_reactions_like_total]
@reactions_love_total = options[:post_reactions_love_total]
@reactions_wow_total = options[:post_reactions_wow_total]
Expand Down

0 comments on commit 8cd2a2a

Please sign in to comment.