使用 Python 更新 Facebook 状态
我正在尝试使用 facebook API 和 pyfacebook
来解决问题更新状态。所以我在这里查看使用pyfacebook更新Facebook页面的状态,我认为没有'不再工作了。
好吧,最后我解决了这个问题:
#!/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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论