[Facebooker-talk] infinite session key

Lee Connell lee.a.connell at gmail.com
Sat Feb 14 21:57:52 EST 2009


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20090214/97cfeae3/attachment.html>


More information about the Facebooker-talk mailing list