本文整理汇总了Python中models.Account.followings_timeline方法的典型用法代码示例。如果您正苦于以下问题:Python Account.followings_timeline方法的具体用法?Python Account.followings_timeline怎么用?Python Account.followings_timeline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Account
的用法示例。
在下文中一共展示了Account.followings_timeline方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_followings_timeline
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import followings_timeline [as 别名]
def test_followings_timeline(self):
account = Account()
tweets = account.followings_timeline()
myid = 43657148
self.assertTrue(myid in tweets)
self.assertTrue(len(tweets[myid]) > 0)
print tweets[myid][0][0]
print tweets[myid][0][1]
示例2: get
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import followings_timeline [as 别名]
def get(self):
account = Account()
timelines = account.followings_timeline()
names = account.followings_name()
screen_names = account.followings_screen_name()
# visits followings
for userid in timelines.keys():
# visits each followings' tweets
for t in timelines[userid]:
tweetid = t[0]
tweet = t[1]
time = t[2]
# if the tweets is imhome, reply to it
if self.is_reply(tweet, time):
msg = u'@' + screen_names[userid] + u' おかえりなさい、' + names[userid] + u'さん。'
time = time + datetime.timedelta(hours=9)
if time.hour >= 22:
msg += '遅くまでお疲れ様でした。'
account.reply(msg, tweetid)
break
示例3: get
# 需要导入模块: from models import Account [as 别名]
# 或者: from models.Account import followings_timeline [as 别名]
def get(self):
account = Account()
timelines = account.followings_timeline()
names = account.followings_name()
screen_names = account.followings_screen_name()
# visits followings
for userid in timelines.keys():
# visits each followings' tweets
for t in timelines[userid]:
tweetid = t[0]
tweet = t[1]
time = t[2]
logging.debug("name : " + names[userid])
logging.debug("tweet : " + tweet)
logging.debug("time : " + time.strftime("%y/%m/%d %H:%M:%S %Z"))
logging.debug("today: " + datetime.datetime.now().strftime("%y/%m/%d %H:%M:%S %Z"))
# if the tweets is greet, reply to it
if self.is_reply(tweet, time):
msg = u'@' + screen_names[userid] + u' おはようございます、' + names[userid] + u'さん。'
account.reply(msg, tweetid)
break