Skip to content

Commit 78e6453

Browse files
authored
Merge pull request #99 from Fullscreen/use-fetch-and-fetch_all-both
Try to make test pass - see if it's working on Travis
2 parents a2a4c70 + 1ad6d54 commit 78e6453

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ For more information about changelogs, check
66
[Keep a Changelog](http://keepachangelog.com) and
77
[Vandamme](http://tech-angels.github.io/vandamme).
88

9+
## 0.2.30 - 2017/10/16
10+
11+
* [BUGFIX] Test should pass when call Page#videos. Partly revert the change
12+
of version 0.2.28
13+
914
## 0.2.29 - 2017/10/16
1015

1116
* [ENHANCEMENT] Use request to get app access token. Do not use

lib/funky/connections/api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def self.fetch_multiple_pages(uri)
3535
json = json_for(uri)
3636
if json[:data].empty?
3737
@try_count ||= 0
38-
if @previous_timestamp && @try_count < 1 && (Date.parse @previous_timestamp rescue nil)
38+
if @previous_timestamp && @try_count < 10 && (Date.parse @previous_timestamp rescue nil)
3939
timestamp = (Date.parse(@previous_timestamp) - 1).strftime('%F')
4040
@try_count += 1
4141
@previous_timestamp = timestamp

lib/funky/page.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ def self.find(page_id)
3131
# fetched by Facebook Graph API.
3232
def videos(options = {})
3333
path_query = "#{id}/videos?fields=id,title,description,created_time,length,comments.limit(0).summary(true),likes.limit(0).summary(true),reactions.limit(0).summary(true)"
34-
path_query << "&since=#{options[:since]}" if options[:since]
35-
videos = Funky::Connection::API.fetch_all(path_query)
34+
videos = []
35+
if options[:since]
36+
path_query << "&since=#{options[:since]}"
37+
videos = Funky::Connection::API.fetch_all(path_query)
38+
else
39+
videos = Funky::Connection::API.fetch(path_query, is_array: true)
40+
end
3641
videos.map {|video| Video.new(video) }
3742
end
3843

lib/funky/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Funky
2-
VERSION = "0.2.29"
2+
VERSION = "0.2.30"
33
end

0 commit comments

Comments
 (0)