S. Woodside
2008-Apr-20 02:35 UTC
[Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions
Here''s a real simple little test I put together based on this thread -- it works for me. Nice. --simon def test_infinite_session if params[''id''].nil? then raise "no FB ID given" end facebook_uid = params[''id''] # do we have UID in our database wu = WebUser.find_by_facebook_uid facebook_uid @facebook_session = Facebooker::Session.create (Facebooker::Session.api_key, Facebooker::Session.secret_key) @facebook_session.secure_with!(wu.facebook_session_key, wu.facebook_uid, 0) render :text => @facebook_session.events.to_s end -- http://simonwoodside.com
William Thomas
2008-Apr-22 18:52 UTC
[Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions
<table cellspacing=''0'' cellpadding=''0'' border=''0'' ><tr><td style=''font: inherit;''>It may be easier to serialize your session with session.to_yaml in your db. You can then reconstitute the session <br><br>session YAML::load(user.facebook_session_yaml)<br><br><br></td></tr></table><br> <hr size=1>Be a better friend, newshound, and know-it-all with Yahoo! Mobile. <a href="http://us.rd.yahoo.com/evt=51733/*http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ "> Try it now.</a>
Mike Mangino
2008-Apr-22 19:36 UTC
[Facebooker-talk] Does anyone have an example of using facebooker with Infinite Sessions
Even better, just store the session key: def store_session(session_key) if self.session_key != session_key update_attribute(:session_key,session_key) end end def facebook_session @facebook_session || returning Facebooker::Session.create do |session| session.secure_with!(session_key,facebook_id,1.day.from_now) end end Mike On Apr 22, 2008, at 1:52 PM, William Thomas wrote:> It may be easier to serialize your session with session.to_yaml in > your db. You can then reconstitute the session > > session = YAML::load(user.facebook_session_yaml) > > > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. > Try it now. _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Jay McGaffigan
2008-Apr-23 00:32 UTC
[Facebooker-talk] integrating facebooker into an existing application
Hi all, So I am trying to understand how to integrate a facebook application into my web application. Mike has given me some good pointers. But I am at a point where I am rummaging through the code and have stumbled upon a problem that I am not sure how to resolve. The issue might be related to this fix: http://rubyforge.org/pipermail/facebooker-talk/2008-March/000471.html but I''m not sure. So let me describe my scenario. I have an existing web application. I want to integrate a Facebook application into it in such a way that after a demo of this we may want to pull the facebook app stuff into it''s own web application. So to start I have added the plugin. And discovered the following dependency in the tests: Rails_integration_tests have a ''require "ruby-debug"'' statement in it. I didn''t have this gem installed and when I removed the require statement and the tests all passed except for one (which causes a warning in Ruby and an error in JRuby). A question I have here is ... is it worth pointing out the dependency on ruby-debug to this list? (I believe it''s a native gem) Next I setup my application to use the proper session store. A quick jump to my app''s homepage and all still looks well. Next I setup my facebooker.yml file. And the problems start for my web app''s non-facebook pages. When I goto my homepage. The style information fails to load. This is due to the fact that all my resources are being referenced with a URL that looks like my callback_url. (http://ip/jay). If I undo the fix referenced in the URL above, my problem goes away, but I don''t want to undo that fix without understanding the implications. Being new to using facebooker, does anyone have a couple of paragraphs they can share on how the routing works for facebooker? Any help would be super appreciated! Jay PS: I''ll be at railsconf also and would be interested in joining for a beer if you''ll have me :)
Mike Mangino
2008-Apr-23 13:17 UTC
[Facebooker-talk] integrating facebooker into an existing application
Jay, can you tell us what your callback url is set to? In general, we expect the callback url to be the same hostname as the rest of your application. Mike On Apr 22, 2008, at 7:32 PM, Jay McGaffigan wrote:> Hi all, > > So I am trying to understand how to integrate a facebook application > into my > web application. Mike has given me some good pointers. But I am at > a point > where I am rummaging through the code and have stumbled upon a > problem that > I am not sure how to resolve. > > The issue might be related to this fix: > http://rubyforge.org/pipermail/facebooker-talk/2008-March/000471.html > > but I''m not sure. > > So let me describe my scenario. > > I have an existing web application. I want to integrate a Facebook > application into it in such a way that after a demo of this we may > want to > pull the facebook app stuff into it''s own web application. > > So to start I have added the plugin. And discovered the following > dependency in the tests: > Rails_integration_tests have a ''require "ruby-debug"'' statement in > it. I > didn''t have this gem installed and when I removed the require > statement and > the tests all passed except for one (which causes a warning in Ruby > and an > error in JRuby). A question I have here is ... is it worth pointing > out the > dependency on ruby-debug to this list? (I believe it''s a native gem) > > Next I setup my application to use the proper session store. > A quick jump to my app''s homepage and all still looks well. > > Next I setup my facebooker.yml file. And the problems start for my > web > app''s non-facebook pages. When I goto my homepage. The style > information > fails to load. This is due to the fact that all my resources are > being > referenced with a URL that looks like my callback_url. > (http://ip/jay). > > If I undo the fix referenced in the URL above, my problem goes away, > but I > don''t want to undo that fix without understanding the implications. > Being > new to using facebooker, does anyone have a couple of paragraphs > they can > share on how the routing works for facebooker? > > Any help would be super appreciated! > > Jay > > PS: I''ll be at railsconf also and would be interested in joining > for a beer > if you''ll have me :) > > > > > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Jay McGaffigan
2008-Apr-23 14:03 UTC
[Facebooker-talk] integrating facebooker into an existing application
Mike, Do you want the specific callback? It''s http://hostname/jay (or do you want the real callback). Let me describe my setup a little. I am doing this Facebook application for work. Myself and one other guy are working on the application. For firewall and security reasons IT has given us a computer with an external ip (with only port 80 open and lot''s of protocols blocked). This computer will ultimately be running the application. However for development I would like to get facebook to hit my computer. So what I did (and if you have a better suggestion... I''m all eyes) is take Apache and setup Mod_rewrite to forward requests to my dev box that have the pattern, http://hostname/jay(/*) and requests that have the pattern http://hostname/kevin(/*) (kevin''s my coworker) forward requests to his dev box. We each have our own sample application (is there a better way to co develop a facebook application?). I didn''t realize the restriction that facebooker is imposing with the callback_url but in hindsight it makes sense. In "production" the issue I am having won''t happen as I could just map the callback url to the IP. But from a development scenario it would have been nice. Thanks! Jay -----Original Message----- From: Mike Mangino [mailto:mmangino at elevatedrails.com] Sent: Wednesday, April 23, 2008 9:17 AM To: Jay McGaffigan Cc: facebooker-talk at rubyforge.org Subject: Re: [Facebooker-talk] integrating facebooker into an existing application Jay, can you tell us what your callback url is set to? In general, we expect the callback url to be the same hostname as the rest of your application. Mike On Apr 22, 2008, at 7:32 PM, Jay McGaffigan wrote:> Hi all, > > So I am trying to understand how to integrate a facebook application > into my > web application. Mike has given me some good pointers. But I am at > a point > where I am rummaging through the code and have stumbled upon a > problem that > I am not sure how to resolve. > > The issue might be related to this fix: > http://rubyforge.org/pipermail/facebooker-talk/2008-March/000471.html > > but I''m not sure. > > So let me describe my scenario. > > I have an existing web application. I want to integrate a Facebook > application into it in such a way that after a demo of this we may > want to > pull the facebook app stuff into it''s own web application. > > So to start I have added the plugin. And discovered the following > dependency in the tests: > Rails_integration_tests have a ''require "ruby-debug"'' statement in > it. I > didn''t have this gem installed and when I removed the require > statement and > the tests all passed except for one (which causes a warning in Ruby > and an > error in JRuby). A question I have here is ... is it worth pointing > out the > dependency on ruby-debug to this list? (I believe it''s a native gem) > > Next I setup my application to use the proper session store. > A quick jump to my app''s homepage and all still looks well. > > Next I setup my facebooker.yml file. And the problems start for my > web > app''s non-facebook pages. When I goto my homepage. The style > information > fails to load. This is due to the fact that all my resources are > being > referenced with a URL that looks like my callback_url. > (http://ip/jay). > > If I undo the fix referenced in the URL above, my problem goes away, > but I > don''t want to undo that fix without understanding the implications. > Being > new to using facebooker, does anyone have a couple of paragraphs > they can > share on how the routing works for facebooker? > > Any help would be super appreciated! > > Jay > > PS: I''ll be at railsconf also and would be interested in joining > for a beer > if you''ll have me :) > > > > > > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk-- Mike Mangino http://www.elevatedrails.com
Mike Mangino
2008-Apr-23 15:31 UTC
[Facebooker-talk] integrating facebooker into an existing application
Check out http://tunnlr.com It''s a service that we built to allow easy to setup ssh tunneling. As long as your employer doesn''t block ssh tunneling, it makes development really easy. It''s not quite ready for release yet, but most of the remaining issues are UI related. Mike On Apr 23, 2008, at 9:03 AM, Jay McGaffigan wrote:> Mike, > > Do you want the specific callback? > > It''s http://hostname/jay (or do you want the real callback). > > Let me describe my setup a little. > > I am doing this Facebook application for work. Myself and one other > guy are > working on the application. For firewall and security reasons IT > has given > us a computer with an external ip (with only port 80 open and lot''s of > protocols blocked). This computer will ultimately be running the > application. However for development I would like to get facebook > to hit my > computer. So what I did (and if you have a better suggestion... I''m > all > eyes) is take Apache and setup Mod_rewrite to forward requests to my > dev box > that have the pattern, http://hostname/jay(/*) and requests that > have the > pattern http://hostname/kevin(/*) (kevin''s my coworker) forward > requests to > his dev box. We each have our own sample application (is there a > better way > to co develop a facebook application?). > > I didn''t realize the restriction that facebooker is imposing with the > callback_url but in hindsight it makes sense. > > In "production" the issue I am having won''t happen as I could just > map the > callback url to the IP. But from a development scenario it would > have been > nice. > > Thanks! > Jay > > > > > -----Original Message----- > From: Mike Mangino [mailto:mmangino at elevatedrails.com] > Sent: Wednesday, April 23, 2008 9:17 AM > To: Jay McGaffigan > Cc: facebooker-talk at rubyforge.org > Subject: Re: [Facebooker-talk] integrating facebooker into an existing > application > > Jay, can you tell us what your callback url is set to? > > In general, we expect the callback url to be the same hostname as the > rest of your application. > > Mike > > On Apr 22, 2008, at 7:32 PM, Jay McGaffigan wrote: > >> Hi all, >> >> So I am trying to understand how to integrate a facebook application >> into my >> web application. Mike has given me some good pointers. But I am at >> a point >> where I am rummaging through the code and have stumbled upon a >> problem that >> I am not sure how to resolve. >> >> The issue might be related to this fix: >> http://rubyforge.org/pipermail/facebooker-talk/2008-March/000471.html >> >> but I''m not sure. >> >> So let me describe my scenario. >> >> I have an existing web application. I want to integrate a Facebook >> application into it in such a way that after a demo of this we may >> want to >> pull the facebook app stuff into it''s own web application. >> >> So to start I have added the plugin. And discovered the following >> dependency in the tests: >> Rails_integration_tests have a ''require "ruby-debug"'' statement in >> it. I >> didn''t have this gem installed and when I removed the require >> statement and >> the tests all passed except for one (which causes a warning in Ruby >> and an >> error in JRuby). A question I have here is ... is it worth pointing >> out the >> dependency on ruby-debug to this list? (I believe it''s a native gem) >> >> Next I setup my application to use the proper session store. >> A quick jump to my app''s homepage and all still looks well. >> >> Next I setup my facebooker.yml file. And the problems start for my >> web >> app''s non-facebook pages. When I goto my homepage. The style >> information >> fails to load. This is due to the fact that all my resources are >> being >> referenced with a URL that looks like my callback_url. >> (http://ip/jay). >> >> If I undo the fix referenced in the URL above, my problem goes away, >> but I >> don''t want to undo that fix without understanding the implications. >> Being >> new to using facebooker, does anyone have a couple of paragraphs >> they can >> share on how the routing works for facebooker? >> >> Any help would be super appreciated! >> >> Jay >> >> PS: I''ll be at railsconf also and would be interested in joining >> for a beer >> if you''ll have me :) >> >> >> >> >> >> >> >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > -- > Mike Mangino > http://www.elevatedrails.com > > >-- Mike Mangino http://www.elevatedrails.com