Skip to content

Instantly share code, notes, and snippets.

@bonyiii
bonyiii / facebook_graph_api.rb
Last active August 29, 2015 14:26 — forked from zosiu/facebook_graph_api.rb
Facebook Graph API w/ Koala
### app access token
graph = Koala::Facebook::OAuth.new APP_ID, APP_SECRET
graph.get_app_access_token # => APP_TOKEN
### create test users with permissions
test_users = Koala::Facebook::TestUsers.new app_id: APP_ID, secret: APP_SECRET
user = test_users.create true, 'email,user_birthday,user_posts', name: 'Bob'
# =>
# { "id" => USER_ID,
# "access_token" => USER_ACCESS_TOKEN,
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
Before do |scenario|
DeferredGarbageCollection.start
end
After do |scenario|
DeferredGarbageCollection.reconsider
end
at_exit do
DeferredGarbageCollection.stop