Update status Facebook using Python

和自甴很熟 提交于 2019-12-18 12:43:00

问题


I'm trying the solve problem update status using facebook API with pyfacebook. So I look at here Update Facebook Page's status using pyfacebook and I think doesn't work anymore.

Well, finally I solve the problem:

#!/usr/bin/python
import facebook
# Replace these with your app's credentials
api_key = 'YOUR_API_KEY'
secret_key = 'YOUR_SECRET_KEY'
client = facebook.Facebook(api_key, secret_key)
client.auth.createToken()
client.login()
print '[*] Please login / give permission application to access you . Then press enter key to continue...',
raw_input()
try:
    client.auth.getSession()
    client.request_extended_permission("publish_stream", popup=False)
    raw_input()   
    cek = client.status.set("Testing update status using facebook API with pyfacebook")
except facebook.FacebookError, e:
    print "ERROR", e    

来源:https://stackoverflow.com/questions/3849624/update-status-facebook-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!