Guest User

Untitled

a guest
Jul 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. oauth = Koala::Facebook::OAuth.new(APP_ID, APP_CODE)
  2. signed_request = oauth.parse_signed_request(params["signed_request"])
  3.  
  4. {
  5. "algorithm"=>"HMAC-SHA256",
  6. "issued_at"=>1303883452,
  7. "user"=>
  8. {
  9. "country"=>"us",
  10. "locale"=>"en_US"
  11. },
  12. "user_id"=>"100002364226618"
  13. }
  14.  
  15. rg = RestGraph.new( :app_id => APP_ID, :secret => APP_SECRET)
  16. parsed_request = rg.parse_signed_request!(params["signed_request"])
  17.  
  18. require 'sinatra'
  19. require 'rest-graph'
  20.  
  21. app_id = '123'
  22. secret = 'abc'
  23. config = {:app_id => app_id,
  24. :secret => secret}
  25.  
  26. post '/' do
  27. rg = RestGraph.new(config)
  28. rg.parse_signed_request!(params['signed_request'])
  29. "#{rg.get('me').inspect.gsub('<', '<')}n"
  30. end
  31.  
  32. run Sinatra::Application
Add Comment
Please, Sign In to add comment