本文整理汇总了Python中twitter.Twitter.authenticate方法的典型用法代码示例。如果您正苦于以下问题:Python Twitter.authenticate方法的具体用法?Python Twitter.authenticate怎么用?Python Twitter.authenticate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.Twitter
的用法示例。
在下文中一共展示了Twitter.authenticate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set
# 需要导入模块: from twitter import Twitter [as 别名]
# 或者: from twitter.Twitter import authenticate [as 别名]
:return:
"""
return set([entry for entry in raw_user_list if entry not in dummies])
if __name__ == '__main__':
args = build_argparser(settings.DEFAULT_URL, settings.DEFAULT_LIST).parse_args()
if args.archive:
urls = fetch_archive_urls(args.url, settings.WM_LOCATION)
print("\n".join(urls))
else:
raw_user_list = fetch_userlist(args.url)
users = cleanup_users(raw_user_list, settings.DUMMY_NAMES)
t = Twitter(settings.CONSUMER_TOKEN, settings.CONSUMER_SECRET)
if not (settings.ACCESS_TOKEN and settings.ACCESS_TOKEN_SECRET):
(access_token, secret) = t.generate_access_token()
print("your access_token: %s" % access_token)
print("your access_token_secret: %s" % secret)
else:
(access_token, secret) = (settings.ACCESS_TOKEN, settings.ACCESS_TOKEN_SECRET)
at = t.authenticate(access_token, secret)
tw_list = at.get_list(args.list)
missing_members = at.add_missing_members(tw_list, users)
if len(missing_members) > 0:
print("added %d users to list %s:" % (len(missing_members), args.list))
print(", ".join(missing_members))