2012-06-27 76 views

回答

5

您可以使用FQL在特定時間段內獲取所有帖子。這裏是一個應該讓你開始的例子:

@feed = Koala::Facebook::API.new(current_user.token) 
to = Time.now.to_i 
yest = 1.day.ago.to_i 
@feed.fql_query("SELECT post_id, actor_id, target_id, message, likes FROM stream WHERE source_id = me() AND created_time > #{yest} AND created_time < #{to} AND type = 80 
AND strpos(attachment.href, "youtu") >= 0") 

require 'koala' 
@graph = Koala::Facebook::API.new("YOUR_ACCESS_TOKEN") 
@graph.fql_query("SELECT post_id, actor_id, target_id, message FROM stream WHERE source_id = me() AND created_time > START_TIME AND created_time < END_TIME LIMIT 10") 

代碼從here借來的。