Skip to content

Instantly share code, notes, and snippets.

@alecnmk
Created February 2, 2012 21:09
Show Gist options
  • Save alecnmk/1725794 to your computer and use it in GitHub Desktop.
Save alecnmk/1725794 to your computer and use it in GitHub Desktop.
Koala and FbGraph return different results for same API Call
namespace :test_api do
task :test_koala => :environment do
user = User.first
graph = Koala::Facebook::API.new user.facebook_access_token
puts "starting fetching user's home with Koala v1.2.1"
feed = graph.get_connections("me", "home")
puts "Initial feed size: #{feed.size}"
while feed = feed.next_page do
puts "Next page size: #{feed.size}"
end
puts "the end"
end
task :test_fb_graph => :environment do
user = User.first
fb_user = FbGraph::User.fetch("me", access_token: user.facebook_access_token)
puts "starting fetching user's home with FbGraph v2.3.1"
feed = fb_user.feed
puts "Initial feed size: #{feed.size}"
while (feed = feed.next).size != 0 do
puts "Next page size: #{feed.size}"
end
puts "the end"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment