Python Chronicles: Updating FB Status using Python & GraphAPI
So, while I was exploring the infinite possibilities presented by Python. I found this great python package facepy. Using which you can update your facebook status from python terminal. The only prerequisite is that you must be facebook developer to gain access to GraphAPI. Following the steps given below, you can also update your status using python:
1. Download facepy and install it by running this command:
2. Create a new application or use an existing one previously created.
3. Run python.exe from command terminal (cmd in Windows). Use the user access token created in the previous step with facepy:
>>
That's it. You may further experiment with GraphAPI using facepy.
Happy Experimenting!!
MG
1. Download facepy and install it by running this command:
python setup install
2. Create a new application or use an existing one previously created.
3. Run python.exe from command terminal (cmd in Windows). Use the user access token created in the previous step with facepy:
>>
from facepy import GraphAPI
>>ACCESS_TOKEN = 'access-token-copied-from-graph-api-explorer-on-web-browser'
>>graph = GraphAPI(ACCESS_TOKEN)
>>graph.post('me/feed', message='Hello World!')
That's it. You may further experiment with GraphAPI using facepy.
Happy Experimenting!!
MG
graph.post('me/feed', message='Hello World!')
ReplyDeleteI am getting Error : OAuthError: [200] (#200) The user hasn't authorized the application to perform this action
But Graph.get('me/posts') this is working fine
ReplyDeleteI think Facebook must have updated their API. I'll check and update the article accordingly. Thanks for the comment and pointing out the error.
ReplyDelete