Robert Matei
2008-Jul-18 01:02 UTC
[Facebooker-talk] Running multiple FB apps off the same Rails app
Hi all, I''m trying to do a few templatized apps. I want them to all run off the same Rails app, which would fetch the right ''theme'' from a database based on params[:fb_sig_api_key]. The themes store the config details of each app, in addition to specific prompts and so on. Presumably this would need a modified Facebooker, which can work with multiple api key / secret key combos instead of a single facebooker.yml file. I''m not sure where to start though, and I figured I''d check with people who know Facebooker better than I do. Any suggestions? Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/facebooker-talk/attachments/20080717/72620789/attachment.html>
Toby Hede
2008-Jul-18 01:16 UTC
[Facebooker-talk] Running multiple FB apps off the same Rails app
I am doing this by using a filter and spoofing the ENV variables. Not pretty but it works. before_filter :authenticate def authenticate @app = find_application ENV[''FACEBOOK_API_KEY''] = @app.api_key ENV[''FACEBOOK_SECRET_KEY''] = @app.secret_key ensure_application_is_installed_by_facebook_user end On Fri, Jul 18, 2008 at 11:02 AM, Robert Matei <rmatei at gmail.com> wrote:> Hi all, > > I''m trying to do a few templatized apps. I want them to all run off the same > Rails app, which would fetch the right ''theme'' from a database based on > params[:fb_sig_api_key]. The themes store the config details of each app, in > addition to specific prompts and so on. > > Presumably this would need a modified Facebooker, which can work with > multiple api key / secret key combos instead of a single facebooker.yml > file. > > I''m not sure where to start though, and I figured I''d check with people who > know Facebooker better than I do. Any suggestions? > > Robert > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >
Jatinder Singh
2008-Jul-18 01:22 UTC
[Facebooker-talk] Running multiple FB apps off the same Rails app
Hi, I have done this with rfacebook, and I believe it should be fairly easy to replicate the approach for Facebooker as well. So I had 2 different namespaces for the facebook applications with in the same rails app. The trick is to set the fb params(api key etc.) in the application_controller.rb of each namespace. For example, application_controller.rb of fb1 would have following, http://pastie.org/236172 Thanks Jatinder On Thu, Jul 17, 2008 at 6:02 PM, Robert Matei <rmatei at gmail.com> wrote:> Hi all, > > I''m trying to do a few templatized apps. I want them to all run off the same > Rails app, which would fetch the right ''theme'' from a database based on > params[:fb_sig_api_key]. The themes store the config details of each app, in > addition to specific prompts and so on. > > Presumably this would need a modified Facebooker, which can work with > multiple api key / secret key combos instead of a single facebooker.yml > file. > > I''m not sure where to start though, and I figured I''d check with people who > know Facebooker better than I do. Any suggestions? > > Robert > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk > >
David Clements
2008-Jul-18 15:41 UTC
[Facebooker-talk] Running multiple FB apps off the same Rails app
We actually just added support for Bebo that should also support multiple rails apps in one instance. I tested it once in my dev environment. Please try this in you facebooker.yml where foo is some unique prefix for the config: foo_api_key: f688cbe01c465d71e4f9bed26722309a foo_secret_key: SECRETKEY foo_canvas_page_name: app_canvas_page_name foo_adapter: FacebookAdapter foo_callback_url: http://mycoolfacebookapp.com I think it requires the same callback_url as the other app, but I don''t remember if it can be different. If this gets a lot of use was can make it a little cleaner. Dave On Thu, Jul 17, 2008 at 7:16 PM, Toby Hede <tobyhede at info-architects.net> wrote:> I am doing this by using a filter and spoofing the ENV variables. Not > pretty but it works. > > before_filter :authenticate > > def authenticate > @app = find_application > > ENV[''FACEBOOK_API_KEY''] = @app.api_key > ENV[''FACEBOOK_SECRET_KEY''] = @app.secret_key > > ensure_application_is_installed_by_facebook_user > end > > On Fri, Jul 18, 2008 at 11:02 AM, Robert Matei <rmatei at gmail.com> wrote: > > Hi all, > > > > I''m trying to do a few templatized apps. I want them to all run off the > same > > Rails app, which would fetch the right ''theme'' from a database based on > > params[:fb_sig_api_key]. The themes store the config details of each app, > in > > addition to specific prompts and so on. > > > > Presumably this would need a modified Facebooker, which can work with > > multiple api key / secret key combos instead of a single facebooker.yml > > file. > > > > I''m not sure where to start though, and I figured I''d check with people > who > > know Facebooker better than I do. Any suggestions? > > > > Robert > > > > _______________________________________________ > > Facebooker-talk mailing list > > Facebooker-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > _______________________________________________ > 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/20080718/c9a831c1/attachment.html>
Toby Hede
2008-Jul-18 23:50 UTC
[Facebooker-talk] Running multiple FB apps off the same Rails app
In my case, the FB credentials are in the database ... so the YML was not an option - but it''s arguably cleaner than my ENV hackin. On Sat, Jul 19, 2008 at 1:41 AM, David Clements <digidigo at gmail.com> wrote:> We actually just added support for Bebo that should also support multiple > rails apps in one instance. I tested it once in my dev environment. > > Please try this in you facebooker.yml where foo is some unique prefix for > the config: > > foo_api_key: f688cbe01c465d71e4f9bed26722309a > foo_secret_key: SECRETKEY > foo_canvas_page_name: app_canvas_page_name > foo_adapter: FacebookAdapter > foo_callback_url: http://mycoolfacebookapp.com > > I think it requires the same callback_url as the other app, but I don''t > remember if it can be different. If this gets a lot of use was can make it a > little cleaner. > > Dave > > > > On Thu, Jul 17, 2008 at 7:16 PM, Toby Hede <tobyhede at info-architects.net> > wrote: >> >> I am doing this by using a filter and spoofing the ENV variables. Not >> pretty but it works. >> >> before_filter :authenticate >> >> def authenticate >> @app = find_application >> >> ENV[''FACEBOOK_API_KEY''] = @app.api_key >> ENV[''FACEBOOK_SECRET_KEY''] = @app.secret_key >> >> ensure_application_is_installed_by_facebook_user >> end >> >> On Fri, Jul 18, 2008 at 11:02 AM, Robert Matei <rmatei at gmail.com> wrote: >> > Hi all, >> > >> > I''m trying to do a few templatized apps. I want them to all run off the >> > same >> > Rails app, which would fetch the right ''theme'' from a database based on >> > params[:fb_sig_api_key]. The themes store the config details of each >> > app, in >> > addition to specific prompts and so on. >> > >> > Presumably this would need a modified Facebooker, which can work with >> > multiple api key / secret key combos instead of a single facebooker.yml >> > file. >> > >> > I''m not sure where to start though, and I figured I''d check with people >> > who >> > know Facebooker better than I do. Any suggestions? >> > >> > Robert >> > >> > _______________________________________________ >> > Facebooker-talk mailing list >> > Facebooker-talk at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/facebooker-talk >> > >> > >> _______________________________________________ >> Facebooker-talk mailing list >> Facebooker-talk at rubyforge.org >> http://rubyforge.org/mailman/listinfo/facebooker-talk > >
David Clements
2008-Jul-19 00:36 UTC
[Facebooker-talk] Running multiple FB apps off the same Rails app
You could overid Facebooker.load_adapter or Facebooker::AdapterBase.facebooker_config possibly. Using the adapter will allow you to run your apps on Bebo as well. Dave On Fri, Jul 18, 2008 at 5:50 PM, Toby Hede <tobyhede at info-architects.net> wrote:> In my case, the FB credentials are in the database ... so the YML was > not an option - but it''s arguably cleaner than my ENV hackin. > > > > On Sat, Jul 19, 2008 at 1:41 AM, David Clements <digidigo at gmail.com> > wrote: > > We actually just added support for Bebo that should also support multiple > > rails apps in one instance. I tested it once in my dev environment. > > > > Please try this in you facebooker.yml where foo is some unique prefix for > > the config: > > > > foo_api_key: f688cbe01c465d71e4f9bed26722309a > > foo_secret_key: SECRETKEY > > foo_canvas_page_name: app_canvas_page_name > > foo_adapter: FacebookAdapter > > foo_callback_url: http://mycoolfacebookapp.com > > > > I think it requires the same callback_url as the other app, but I don''t > > remember if it can be different. If this gets a lot of use was can make > it a > > little cleaner. > > > > Dave > > > > > > > > On Thu, Jul 17, 2008 at 7:16 PM, Toby Hede <tobyhede at info-architects.net > > > > wrote: > >> > >> I am doing this by using a filter and spoofing the ENV variables. Not > >> pretty but it works. > >> > >> before_filter :authenticate > >> > >> def authenticate > >> @app = find_application > >> > >> ENV[''FACEBOOK_API_KEY''] = @app.api_key > >> ENV[''FACEBOOK_SECRET_KEY''] = @app.secret_key > >> > >> ensure_application_is_installed_by_facebook_user > >> end > >> > >> On Fri, Jul 18, 2008 at 11:02 AM, Robert Matei <rmatei at gmail.com> > wrote: > >> > Hi all, > >> > > >> > I''m trying to do a few templatized apps. I want them to all run off > the > >> > same > >> > Rails app, which would fetch the right ''theme'' from a database based > on > >> > params[:fb_sig_api_key]. The themes store the config details of each > >> > app, in > >> > addition to specific prompts and so on. > >> > > >> > Presumably this would need a modified Facebooker, which can work with > >> > multiple api key / secret key combos instead of a single > facebooker.yml > >> > file. > >> > > >> > I''m not sure where to start though, and I figured I''d check with > people > >> > who > >> > know Facebooker better than I do. Any suggestions? > >> > > >> > Robert > >> > > >> > _______________________________________________ > >> > Facebooker-talk mailing list > >> > Facebooker-talk at rubyforge.org > >> > http://rubyforge.org/mailman/listinfo/facebooker-talk > >> > > >> > > >> _______________________________________________ > >> Facebooker-talk mailing list > >> Facebooker-talk at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/facebooker-talk > > > > > _______________________________________________ > 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/20080718/d1f17c33/attachment.html>