What I use in my applications is to simply fetch the image from here:
"http://graph.facebook.com/%(user_id)s/picture?width=%(width)s&height=%(height)s"
Replacing the templated variables accordingly.
Then you can do something like this:
import urllib2
picrequest = urllib2.Request(PROPER_URL_MADE_WITH_PREVIOUS_TEMPLATE,
None, {})
picfile = urllib2.urlopen(picrequest)
picfile.name = picfile.geturl().split('/')[-1]
user.update_record(profile_pic=db.fb_user.profile_pic.store(picfile))
# Obviously, for this to work, the user will need to have a profile_pic
field.
Now you have a copy of the user's photo and can use that to show it.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.