Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- oauth = Koala::Facebook::OAuth.new(APP_ID, APP_CODE)
- signed_request = oauth.parse_signed_request(params["signed_request"])
- {
- "algorithm"=>"HMAC-SHA256",
- "issued_at"=>1303883452,
- "user"=>
- {
- "country"=>"us",
- "locale"=>"en_US"
- },
- "user_id"=>"100002364226618"
- }
- rg = RestGraph.new( :app_id => APP_ID, :secret => APP_SECRET)
- parsed_request = rg.parse_signed_request!(params["signed_request"])
- require 'sinatra'
- require 'rest-graph'
- app_id = '123'
- secret = 'abc'
- config = {:app_id => app_id,
- :secret => secret}
- post '/' do
- rg = RestGraph.new(config)
- rg.parse_signed_request!(params['signed_request'])
- "#{rg.get('me').inspect.gsub('<', '<')}n"
- end
- run Sinatra::Application
Add Comment
Please, Sign In to add comment