本文整理汇总了Python中pyfb.Pyfb.set_permissions方法的典型用法代码示例。如果您正苦于以下问题:Python Pyfb.set_permissions方法的具体用法?Python Pyfb.set_permissions怎么用?Python Pyfb.set_permissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyfb.Pyfb
的用法示例。
在下文中一共展示了Pyfb.set_permissions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Pyfb
# 需要导入模块: from pyfb import Pyfb [as 别名]
# 或者: from pyfb.Pyfb import set_permissions [as 别名]
#!/usr/bin/env python
from pyfb import Pyfb
import auth
#Your APP ID. It Needs to register your application on facebook
#http://developers.facebook.com/
FACEBOOK_APP_ID = '114757805341859'
permissions = [auth.USER_ALL_PERMISSIONS]#, auth.FRIENDS_ALL_PERMISSIONS]
facebook = Pyfb(FACEBOOK_APP_ID)
facebook.set_permissions(auth.USER_ALL_PERMISSIONS)
#Opens a new browser tab instance and authenticates with the facebook API
#It redirects to an url like http://www.facebook.com/connect/login_success.html#access_token=[access_token]&expires_in=0
facebook.authenticate()
#Copy the [access_token] and enter it below
token = raw_input("Enter the access_token\n")
#Sets the authentication token
facebook.set_access_token(token)
#Gets info about myself
me = facebook.get_myself()
print "-" * 40
print "Name: %s" % me.name
print "From: %s" % me.hometown.name
print "Now : %s" % me.location.name