Lee ---
Don''t use One Time Passwords as that route has been deprecated by
Facebook.
Instead, you should prompt the user for the appropriate extended permission.
http://wiki.developers.facebook.com/index.php/Extended_permissions
Cheers
Vince
----
Vincent Chu
On Sat, Feb 14, 2009 at 6:57 PM, Lee Connell <lee.a.connell at
gmail.com>wrote:
> Below is code that i''m trying to get to use infinite sessions, i
went on
> facebook and created my one-time key using the code-gen which is suppose to
> keep you logged in permanently. When I try to secure_with! it tells me
> session is expired or not valid, what am I doing wrong?
> #!/usr/bin/env ruby
> require ''rubygems''
> require ''facebooker''
>
> API_KEY = ''myapikey''
> API_SECRET = ''mysecret''
>
> session = Facebooker::Session.create API_KEY, API_SECRET
> cached = true
>
> if cached then
> token = "my6digitkey"
> userid = "myuserid"
> session.secure_with! token, userid, 0
> else
> token = session.auth_token
> puts "Paste the URL into your web browser and login"
> puts session.login_url + "&auth_token=#{token}"
> puts "Hit return to continue..."
> gets
> end
>
> session.user.populate :name, :status, :pic_square, :uid
>
> puts "ID: #{session.user.uid}"
> puts "Full Name: #{session.user.name}"
> puts "Status: #{session.user.status.message}"
> puts "Picture: #{session.user.pic_square}"
>
> friends = session.user.friends! :name, :status
> friends.each do |friend|
> puts "First Name: #{friend.name}"
> puts "Status: #{friend.status.message}"
> end
>
> _______________________________________________
> Facebooker-talk mailing list
> Facebooker-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/facebooker-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/facebooker-talk/attachments/20090215/953370e5/attachment.html>