下面的代码显示了如何在Twitter的API上获取访问令牌。我想使用OAuth为Facebook API做同样的事情。
#oauth = OAuth::Consumer.new(APP_CONFIG['twitter_consumer_key'], APP_CONFIG['twitter_consumer_secret'], :site => 'http://api.twitter.com', :request_endpoint => 'http://api.twitter.com', :sign_in => true)
# Get the request tokens from the API
rt = oauth.get_request_token
rtoken = rt.token # request token
rsecret = rt.secret # request token secret
# Go to url and click ""Allow access” when prompted
# http://api.twitter.com/oauth/authorize?oauth_token=your_request_token_from_above
# Get the access tokens from the API
at = rt.get_access_token
oauth_token = at.token
oauth_token_secret = at.secret
任何人都知道如何实现这一目标?