当前位置: 首页>>代码示例>>Python>>正文


Python Account.followings_timeline方法代码示例

本文整理汇总了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]
开发者ID:so-c,项目名称:nozomi_miraha,代码行数:10,代码来源:test_account.py

示例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
开发者ID:so-c,项目名称:nozomi_miraha,代码行数:23,代码来源:welcome_back.py

示例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
开发者ID:so-c,项目名称:nozomi_miraha,代码行数:26,代码来源:hello_replier.py


注:本文中的models.Account.followings_timeline方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。