本文整理汇总了Python中TwitterAPI.TwitterOAuth.read_file_object方法的典型用法代码示例。如果您正苦于以下问题:Python TwitterOAuth.read_file_object方法的具体用法?Python TwitterOAuth.read_file_object怎么用?Python TwitterOAuth.read_file_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TwitterAPI.TwitterOAuth
的用法示例。
在下文中一共展示了TwitterOAuth.read_file_object方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_async
# 需要导入模块: from TwitterAPI import TwitterOAuth [as 别名]
# 或者: from TwitterAPI.TwitterOAuth import read_file_object [as 别名]
def run_async(self):
auth = TwitterOAuth.read_file_object(self.wrapper.getFileObject(__file__, "TwitterAPI/credentials.txt"))
api = TwitterAPI(auth.consumer_key, auth.consumer_secret, auth.access_token_key, auth.access_token_secret)
# list of user id to follow (by Nazli)
""" '@StiftenAGF','@jpaarhus','#Aarhus','@AarhusKultur','@smagaarhus','@AarhusNyheder','@AarhusPortaldk',
'@Aarhus2017','@OpenDataAarhus', '@aarhusupdate','@AskVest','@SundhedOgOmsorg','@ArhusVejr','@aarhus_ints',
'@AGFFANdk','@AarhusCykelby','@VisitAarhus','@larshaahr' """
users = ['3601200017', '3370065087', '3330970365', '2911388001', '2706568231',
'2647614595', '2201213730', '1324132976', '1065597596', '816850003', '763614246',
'210987829', '159110346', '112585923', '77749562', '38227253', '36040150']
# list of terms to track
tracks = ['#Aarhus']
print "TAA ready."
try:
r = api.request('statuses/filter', {'locations': self.location, 'follow': ','.join(users), 'track': ','.join(tracks)})
except:
print r.text
for item in r:
self.tweet = item
# print item
self.wrapper.update()
if self.abort.is_set():
break