Created
November 6, 2009 20:42
-
-
Save zenchild/228275 to your computer and use it in GitHub Desktop.
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
# Initial mock-up of a Facebook Connect adapter for Facebooker. This takes some additional | |
# changes in session.rb if you want it to be cleanly implemented. | |
module Facebooker | |
class FacebookConnectAdapter < FacebookAdapter | |
def secret_key | |
warn 'Secret Keys are depreciated in Facebook Connect' | |
return nil | |
end | |
def login_url_base | |
"http://#{www_server_base_url}/login.php?api_key=#{api_key}&connect_display=popup&v=1.0&next=http://#{www_server_base_url}/connect/login_success.html&cancel_url=http://#{www_server_base_url}/connect/login_failure.html&fbconnect=true&return_session=true&req_perms=read_stream,publish_stream,offline_access" | |
end | |
end | |
end |
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
--- a/lib/facebooker/session.rb | |
+++ b/lib/facebooker/session.rb | |
@@ -547,9 +547,27 @@ module Facebooker | |
end | |
class Desktop < Session | |
- def login_url | |
- super + "&auth_token=#{auth_token}" | |
- end | |
+ | |
+ | |
+ def initialize(api_key) | |
+ @api_key = api_key | |
+ @batch_request = nil | |
+ @session_key = nil | |
+ @uid = nil | |
+ @auth_token = nil | |
+ @secret_from_session = nil | |
+ @expires = nil | |
+ end | |
+ | |
+ def self.create(api_key=nil) | |
+ api_key ||= self.api_key | |
+ raise ArgumentError unless !api_key.nil? | |
+ new(api_key) | |
+ end | |
+ | |
+ #def login_url | |
+ # super | |
+ #end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment