I'm trying to write a simple app that lets a user grant my code permission to write to her page's Facebook stream. As I understand it, it should be as easy as:
I've been reading the wiki for days. Notes on pyfacebook are at least a year out of date, and people have pointed me to the socialauth app for Django which appears to be equally out of date and focused on targeting users as opposed to their pages. I can't even do #1 up there, let along #2 and 3.
If someone could show me how to use Django/Python to request/receive permission to write to a Facebook stream, that would be a great start.
Any help would be greatly appreciated.
Have you looked at minifb? Their examples page shows basically everything you need to know to request authorization and receive a session key. (Also, the github page for pyfacebook shows that the library is still alive)
So, for your scenario you'd need:
For this, basically, add this form on your template:
<form promptpermission="publish_stream"> <input type="submit" value="Allow Publish Stream"> </form>
Kudos to the Facebook developers, by the way. Very nice official documentation.
EDIT: I'm not allowed to comment yet so: Should you face problems getting the uid, check this question and the references.
After a lot of tinkering, I appear to have solved all of my problems in Facebookland:
enable_profile_selector=1which will make sure that a list of pages is generated from which the user can select which pages (if any) will grant these permissions.
Anyway, I detailed it all on my blog if anyone is interested. Thanks for your help!