Hello,

I have developed a few apps for facebook using PHP but I really want switch 
future development to web2py.

I have not found any good updated base facebook web2py apps to start from.

A lot of the FB python code I have found applies to Django or assumes you 
will be using google app engine which I am not.

I have created modules and tried 3 versions of a facebook.py file I have 
found 

1) https://github.com/pythonforfacebook/facebook-sdk
2) The order code  from the hellowfacebook web2py example
3) https://github.com/facebook/fbconsole

I have included the Javascript SDK in my web2py view found here.
https://developers.facebook.com/docs/reference/javascript/
Since I understand it is best to set and grab cookies and initiate a login 
and session with  the JS SDK

I also tried mods of  recommend code here but can't get it to work either.
http://stackoverflow.com/questions/2727118/getting-facebook-oauth-access-token-through-python-sdk-does-not-seem-to-be-worki

I am still new to web2py so maybe I have something in the wrong place or 
have not declared or imported things properly.

in my default.py I can import any facebook module code I use with
import facebook 

But where do I put this code that actually calls the defs and objects?  in 
my controller? another module or view?

cookie = facebook.get_user_from_cookie(self.request.cookies, FACEBOOK_APP_ID, 
FACEBOOK_APP_SECRET)
graph = facebook.GraphAPI(cookie["access_token"])
current_user = graph.get_object("me")



So my questions are...
1) Is there a base application with up-to-date code I can use to create a 
FB canvas or tab page app that creates a link for a user to login, let's me 
grab the cookie/access token from the JS SDK  and pull some info from the 
FB graph api.

2) which python FB classes or API or SDK should I use and import to best 
use with web2py.

3) where is the best place to place the code that calls the facebook class 
defs and methods? In a controller, controller def, module or view?

Thanks for any input.
Ben

Reply via email to