开发者

Update status Facebook using Python

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    
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜