facebookarchive / fbconsole

A micro api client for writing scripts against the Facebook Graph API.
Other
325 stars 74 forks source link

feature request: programmatic oauth login #14

Closed deanmalmgren closed 9 years ago

deanmalmgren commented 12 years ago

I would like to have a cron job running on our server that automatically pulls in information about Posts on our company's Page to ultimately display on our company's website. Having to pull up a browser every time an access token becomes invalid (if I'm understanding things correctly, these access tokens expire after a certain period of time), is really not an option for me. It would be awesome to have a programmatic oauth login for facebook "apps" that are specifically designed to pull in data from facebook.

ferrazrafael commented 11 years ago

maybe using a headless webkit browser can make it less painful. Look

http://webscraping.com/blog/Scraping-JavaScript-webpages-with-webkit/

mattia-beta commented 11 years ago

You can use the "offline_access" permisson to get an infinite session key. It's like a normal token, but this won't expire. In this way you will be able to do your cron-job without problems.

ferrazrafael commented 11 years ago

isnt offline_acess deprecated?

https://developers.facebook.com/roadmap/offline-access-removal/

mattia-beta commented 11 years ago

It still works. If you get an infinite session key it won't exipire even if it is deprecate.

"Once the migration has been enabled, existing use access_tokens, with the offline_access permission, will continue to work without any change to their expiration time"

underyx commented 11 years ago

Am I doing something wrong here? Because this code opens a new browser window every few hours or so for me.

fbconsole.AUTH_SCOPE = ['offline_access']
fbconsole.authenticate()
glfafn commented 11 years ago

The offline_access was removed at December 5, 2012.You can still get a long-live use access_token which lasts for 60 days, read bellow

https://developers.facebook.com/roadmap/offline-access-removal/ https://developers.facebook.com/roadmap/completed-changes/