Created
June 27, 2011 06:03
-
-
Save mataki/1048376 to your computer and use it in GitHub Desktop.
FbGraphでテストユーザ作成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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