本文整理汇总了Python中twitter.Twitter.uriparts方法的典型用法代码示例。如果您正苦于以下问题:Python Twitter.uriparts方法的具体用法?Python Twitter.uriparts怎么用?Python Twitter.uriparts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter.Twitter
的用法示例。
在下文中一共展示了Twitter.uriparts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_token_file
# 需要导入模块: from twitter import Twitter [as 别名]
# 或者: from twitter.Twitter import uriparts [as 别名]
from twitter import Twitter, TwitterError
from twitter.oauth import OAuth, read_token_file
from twitter.oauth_dance import oauth_dance
import os
# get your own at https://dev.twitter.com/apps/new
CONSUMER_KEY='MSkGnYHDUgDxZbTBDkfP8Q'
CONSUMER_SECRET='BEN3D56OWddggyuYUUcENWK1OPmqVCy5EGIq1mg'
# path to where your oauth credentials are stored; by default .oauth in the same directory
oauth_filename = os.path.dirname(__file__) + os.sep + '.oauth'
# use the function 'from twitter.oauth import write_token_file' to create this file
oauth_token, oauth_token_secret = read_token_file(oauth_filename)
twitter = Twitter(domain='search.twitter.com')
twitter.uriparts = ()
poster = Twitter(
auth=OAuth(
oauth_token, oauth_token_secret, CONSUMER_KEY, CONSUMER_SECRET),
secure=True,
api_version='1.1',
domain='api.twitter.com')
# get the status_id of the last tweet to which you replied
last_id_replied = [tweet['in_reply_to_status_id'] for tweet in poster.statuses.user_timeline() if tweet['in_reply_to_status_id'] != None][0]
# your bot's twitter handle
handle = "lovecraft_ebook"