search for: facebook_sess

Displaying 20 results from an estimated 25 matches for "facebook_sess".

2008 Dec 16
3
ApplicationProperties
...ring what the appropriate way to use the applicationproperties.rb model was. I was hoping to query it to find out which users are developers for my app and then grant special permissions to them ... I tried creating something like this: class ApplicationProperties < ActiveRecord::Base def facebook_session @facebook_session ||= returning Facebooker::Session.create do |session| session.secure_with!(session_key,User.find(:first).facebook_id,1.hour.from_now) end end end but that doesn''t seem to help, i.e. the facebook session thing is specific to the user model ....
2008 Jan 23
2
Accessing the current session
...ion (and other fb user variables from the session) at the start of my controller, so that all the actions in that controller can make use of it. Here''s the code: class FacebookController < ApplicationController ensure_application_is_installed_by_facebook_user fb_session = session[:facebook_session] # ... action functions here ... end I''m getting this error: TypeError (Symbol as array index): .//app/controllers/facebook_controller.rb:3:in `[]'' .//app/controllers/facebook_controller.rb:3 If I put the session[:facebook_session] reference inside any of the acti...
2008 Dec 19
1
session[:facebook_session]
not sure if my prior message went through, given that I sent before confirming my membership to the list. Is anyone concerned with the practice of saving the entire fb session object in the session hash? I''m likely going to blow away all the "@var |= " statements and just use the api calls when I need to access data, since my understanding is that it''s bad
2008 Feb 14
0
New features: Application properties and cookies
Hey guys- Two new features: Set/get app properties like this: properties = { :application_name => "Video Jukebox", :default_fbml => "blah" } facebook_session.admin.set_app_properties(properties) properties = facebook_session.admin.get_app_properties(:application_name, :default_fbml) Set/get cookies: facebook_session.data.set_cookie(uid, ''name'', ''value'') facebook_session.data.get_cookies(uid) Let me...
2008 May 06
1
check_friendship method only returning value of last pair
Hello, I''m new to facebooker and ruby, so not sure if the issue I am having is due to my misunderstanding or a bug in facebooker plugin. Here is what I have: def show @current_user ||= facebook_session.user @member ||= params[:id].to_s==@current_user.id.to_s ? @current_user : Facebooker::User.new(params[:id]) #for each of current_user''s friends, check if they are friends with the member and return an array of only the mutual friends @mutual_friends = [] #initializing arra...
2008 Jun 12
6
Session Best Practices
...:ensure_authenticated_to_facebook, :only =&gt; [:authenticate_facebook, :edit_facebook] 2) when the user links into facebook, facebooker authenticates and redirects back to my application 3) i detect the "auth_token" param in my method and store the session_key 4) now the session[:facebook_session] is good to go .... when a user logs in i detect if they have ever authorized facebook, if they have a reconstitute a facebooker session : session[:facebook_session] ||=&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; returning Facebooker::Session.cr...
2008 Jun 12
0
Double Frame Problem
...lem of the nested frame on the login/install pages (when using iframes rather than fbml), is to use JS to cause a redirect (c.f. http://rubyforge.org/pipermail/facebooker-talk/2008-May/000638.html, http://webjazz.blogspot.com/2008/03/gotchas-of-internal-iframe-facebook.html): def create_new_facebook_session_and_redirect! session[:facebook_session] = new_facebook_session render :layout => false, :inline => %Q{<script type="text/javascript"> top.location.href = "<%= session[:facebook_session].login_url -%>" </script>} end def ap...
2008 Jun 03
2
Order of authentication methods is causing unnecessary call to API?
...t that not only contains an auth_key but also contains a valid session key. Occasionally I am seeing that Facebook server is occasionally sending a connection reset during the auth key authentication method, this caused me to notice that secure_with_token is given precedence in the code: def set_facebook_session returning session_set = session_already_secured? || secure_with_token! || secure_with_facebook_params! do if session_set capture_facebook_friends_if_available! Session.current = facebook_session end end end This seems wrong to...
2008 Mar 12
3
a way to restrict who can install your app, for private testing
...9;'s messy but works. Put at the top of your controller, at the end of your filters. # This filter is only until we open everything up before_filter do |c| acceptable_uids = [''594180515'', ''122612996''] unless acceptable_uids.include? c.get_facebook_session.user.uid RAILS_DEFAULT_LOGGER.debug "my UID = " + c.get_facebook_session.user.uid + " but acceptable_uids = " + acceptable_uids.to_s raise RuntimeError("This isn''t going to work") end end def get_facebook_session @facebook_...
2008 Mar 25
7
Facebooker::Session::SessionExpired (Session key invalid or no longer valid)
Hi All, I''m having horrible problems with this exception, which seems to happen as soon as I access the session object. Does anyone know what the path is to recover from this? This post looked to be the most promising: http://rubyforge.org/pipermail/facebooker-talk/2007-December/000047.html And I followed all of the steps except switching my session store, and modifying the default
2008 Jan 10
3
A best practices question
Hey everyone. I''ve got a best practices question. How are you guys rendering newsfeeds? We have a couple of apps where we send newsfeed items from a backend process. As such, we aren''t in the context of a controller and can''t use the rails template rendering. We''ve tried about 3 different ways to make that bearable, but aren''t having much
2007 Dec 22
1
upgraded to rails 2.0.1 and borked sessions
I just pushed my facebook app up to 2.0.1 and noticed that I am now getting these errors: ActionView::TemplateError (Session key invalid or no longer valid) on line #3 of users/index.fbml.erb: It appears that I get the facebook_session object back but when i introspect and try and get the user''s name or something i get the session error. Has anyone else had these problems? Later, Mark
2008 Apr 04
0
something wrong with event_members
I''ve got this code in one of my views: <% for event in @facebook_session.events( :uid => @facebook_user.uid ) %> <p><%= @facebook_session.event_members(event.eid).length %></p> <% end %> It should print the # of people coming to each of this user''s events. Let''s say that would be "5 12 8". Ins...
2008 May 15
3
Facebooker support for iframe apps
Hi facebooker-ers, It looks to me like facebooker does not currently support iframe facebook apps - or am I missing something? My first problem as I understand it is as follows - When you are logged into facebook, and access a facebook application, facebook tacks on a whole lot of extra fb_sig parameters to the request (including fb_sig_user) that the application can then validate to
2008 Apr 08
3
Session Expired for Profile Publishing
Ok. I''m not having any success with publishing profile FBML. Example code: class WelcomeController < ApplicationController layout "facebook" ensure_application_is_installed_by_facebook_user def index @user = facebook_session.user ... @user.profile_fbml = render_to_string( :template => ''welcome/profile'' ) end end Results in this error: Facebooker::Session::SessionExpired (Session key invalid or no longer valid): /vendor/plugins/facebooker/lib/facebooker/parser.rb:386:in `proces...
2008 Jan 24
1
New Batch API method
Anyone started implementing the new Batch api method? BJ ----- BJ Clark the science department bjclark at scidept.com www.scidept.com
2008 Jan 26
0
New feature: get profile pictures
The profile picture album is treated as a special album by Facebok and is not returned in the normal get photo albums API call. A bunch of special operations have to be performed to get the aid for the profile picture album. I added a method to User to get the profile pics. Use as follows: facebook_session.user.profile_photos # returns Photo objects Enjoy, Shane -- http://myfitbuddy.com | http://shanesbrain.net | http://crimsonjet.com
2008 Mar 18
0
Merge Facebook friends with app friends
I have an attribute on my user model called friends, is it possible to merge the session[:facebook_session].user.friends_with_this_app with the friends attribute? Optimally I could call @user.friends and it would return the standalone app''s friends and the Facebook friends who have the app.
2008 Mar 27
0
handling post-remove URL / uninstall of application
...] before_filter :get_user, :except => :post_remove Now I''ve defined something like this in my controller: def post_remove if request.post? raise "Incorrect API Key" unless params[''fb_sig_api_key''] == Facebooker::Session.api_key #session[:facebook_session].api_key my_user = WebUser.find_by_facebook_uid params[''fb_sig_user''] WebUser.destroy my_user end end Unfortunately the call to Facebooker::Session.api_key isn''t working, below is my test code and the error. It''s not strictly necessary...
2008 Mar 30
0
undefined method using ensure_authenticated
...e this message: "undefined local variable or method `ensure_authenticated_to_facebook'' for FacebookController:Class" My controller is defined: << class FacebookController < ApplicationController ensure_authenticated_to_facebook def index @facebook_user = session[:facebook_session].user end end >> I have this route: << map.root :controller => "facebook" >> I am using facebooker as a plugin inside my Rails app. Any help would be greatly appreciated as I am really stumped on this one. Toby Hede