0

For a small console-based notification script I want to show the unread message and notification count from facebook. Currently I am stuck with the Facebook API. Apparently, using OAuth2 and the Graph API, it is not possible to access Facebook without some webapp using javascript or so. The infinite session key way seems to be deprecated and the Facebook for devices way is not yet open to the public.

Is there any way I can authenticate myself (and, atm. only me!) to facebook through a pure python script? It is fine for me to access some url and fetch a one-time auth token.

Community
  • 1
  • 1
janoliver
  • 7,744
  • 14
  • 60
  • 103
  • Tried this? http://www.pythonforfacebook.com/ – KingCronus Oct 09 '12 at 08:36
  • Both these apis are tied to some web-app and need to make web requests, as far as I can see. And yes, I already found them. – janoliver Oct 09 '12 at 08:41
  • Well of course you need to make web requests, Facebook is on the web...Python is more than capable of making web requests, for example: urllib.urlopen – KingCronus Oct 09 '12 at 08:43
  • Yes, web request only would be fine, but it appears from the developers docs I linked to in my question, as if it is currently not possible without the use of a browser. If it is, however, I would be delighted if somebody could give me a little hint or a link with an example. Thanks! – janoliver Oct 09 '12 at 08:46
  • http://docs.python.org/dev/library/urllib.request.html – KingCronus Oct 09 '12 at 08:47

1 Answers1

0

Whether you classify your app as web based or desktop based, the user will need to be authenticated using OAuth. You can do this using the Debug Console if you wish. In order to then make API calls, all you'll need is the access_token after that.

Infinite session keys has been deprecated, but you can use long-lived sessions instead.

Niraj Shah
  • 15,087
  • 3
  • 41
  • 60