Example: before_filter in rails or class ApplicationController < ActionController::Base before_filter :require_facebook_login end class MyController < ApplicationController def index end end # all controllers inherit from ApplicationController and the before_filter in ApplicationController elegantly forces the user to login to facebook
The implementation of pyfacebook I saw in one of the example apps was to import pyfacebook or facebook.py as a module and set the api and secret keys in the controller. And if you want to enforce a facebook login before using the app, you would have to call require_facebook_login(request,facebook_settings) in every action you write. That is not very DRY. What would be a better implementation in web2py for integrating pyfacebook or any facebook app solution? Also, are there any examples to implement a facebook iframe canvas app using the facebook python sdk or some other solution? I have been googling with no luck. On Jun 9, 9:43 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > I do not undersand. can you rpovide an example? > > On Jun 9, 11:28 pm, Binh <btbinht...@gmail.com> wrote: > > > Controller would be useful for a facebook canvas app where all > > requests are delegated to all the other controllers. > > The example facebook app shows the use of pyfacebook to handle > > requests on the index action in the default controller. > > > Is it possible to hookup pyfacebook in a DRY way that all controllers > > can handle facebook requests or controllers that can inherit from > > default.py or something like that? > >