views:

443

answers:

3

I just want to import my facebook status and photos to my personal django website but all the examples and documentation i can find are for developing facebook applications.

A simple rss feed would be enough but it doesnt seem to exist in facebook. Do i really have to create a full facebook app to do this?

A: 

Probably. Anything that bypassed authentication would be a fairly large privacy issue.

Azeem.Butt
+2  A: 

A simple facebook application isn't that hard ... excluding trying to decipher the soup on developers.facebook.com.

The "problem" is that you need to get an application key, application secret, and sometimes a session key in order to access the web services. Unless someone is sharing a service to do just that (I haven't looked, and you'd need to trust them) then the only way to fulfill the requirements are to create an application. However, the application key/application secret don't actually require that you write anything. They will show up in the Facebook Developer Application (the application that allows you to edit your applications...)

Now, all you need is a session key (however, a session key is not always required, see the Understanding Sessions link below) -- and hopefully a permanent one. To do this, ask for the extended offline_access permission**. If you grant that to an application then it can get a session for you whenever it feels like it (or rather, the session does not follow the one-hour expiration policies for that application). Extended permissions. Understanding Sessions. Oh, but ignore that 'auth.renewOfflineSession(UID)' example -- the method doesn't exist. I told you the "developer" documentation was soup :-)

You can use the URL in format: http://www.facebook.com/tos.php?api_key=YOURAPIKEY&req_perms=offline_access to request the permission of yourself. Now see the links below :-)

Extra information in:

**I'm not entirely sure if new changes to the FB policy affect forever-sessions, but this link seems more than relevant to the task at hand: http://blog.jylin.com/2009/10/01/loading-wall-posts-using-facebookstream_get/

http://stackoverflow.com/questions/617043/getting-offline-access-to-work-with-facebook

http://stackoverflow.com/questions/1059640/facebook-offline-access-step-by-step

(You need never post/share your facebook application -- you can keep it in sandbox mode forever.)

pst
Hey thanks, thats a big help.
sean2000
A: 

With the release of the new graph api, this is pretty simple once you get your oauth token. Unfortunately you will need to create an app, but it can be a rather small one to get your oauth token so facebook can authorize your requests. You can use the python sdk here: http://github.com/facebook/python-sdk/

Once you have your token, you make a call to: https://graph.facebook.com/[your profile]/statuses?token=[your token]

And you will get json back.

If you first login to facebook and then go to the documentation page you can see the working example by clicking on the statuses link in the connections table.

http://developers.facebook.com/docs/reference/api/user

dar