Skip to content

Instantly share code, notes, and snippets.

@mataki
Created June 27, 2011 06:03
Show Gist options
  • Save mataki/1048376 to your computer and use it in GitHub Desktop.
Save mataki/1048376 to your computer and use it in GitHub Desktop.
FbGraphでテストユーザ作成
# -*- coding: utf-8 -*-
require "rubygems"
require "fb_graph"
app_id = ""
csecret = ""
app = FbGraph::Application.new(app_id, :secret => csecret)
# ユーザ作って友達にするとか
# user1 = app.test_users.detect { |user| user.identifier.to_s === 100002534024472.to_s }
# user2 = app.test_user!(:installed => false)
# user1.friend!(user2)
# テストユーザ一覧 URLはログインURL そのURLにアクセスするとそのユーザとしてログインできる(しないときは同じURLにアクセス)
app.test_users.each do |user|
puts user.identifier
puts user.friends.map{ |f| f.identifier }.inspect rescue puts "?"
puts user.login_url
puts "---"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment