def main(argv): """main function""" with TwitterBot(BOT_CONFIG) as tw_bot: is_test = False if len(argv) >= 1: if argv[0] == 'test': is_test = True tw_bot.is_test = is_test elif argv[0] == 'init': # Initialize database. tw_bot.create_database() return elif argv[0] == 'follow': tw_bot.make_follow_list_from_followers() return else: raise Exception('Unknow argument: argv={}'.format(argv)) with JobManager() as job_manager: #register_twitter_bot_jobs(job_manager, tw_bot) video_bot = TwitterVideoBot(BOT_CONFIG) video_bot.is_test = is_test register_twitter_video_bot_jobs(job_manager, video_bot) # Run jobs. job_manager.run()
def test_youtube_video_post(self): bot = TwitterVideoBot(BOT_CONFIG) bot.is_test = True bot.youtube_video_post('mbaacc OR mbaa', None)
def test_nico_comment_post(self): bot = TwitterVideoBot(BOT_CONFIG) bot.is_test = True bot.nico_comment_post('mbaacc', self.prev_datetime, filter_func=self.filter_func)
def test_nico_latest_commenting_video_post(self): bot = TwitterVideoBot(BOT_CONFIG) bot.is_test = True bot.nico_latest_commenting_video_post('作業用BGM', self.prev_datetime)
def test_nico_video_post(self): prev_datetime = datetime.datetime.strptime('2013-01-25 00:00:00', '%Y-%m-%d %H:%M:%S') bot = TwitterVideoBot(BOT_CONFIG) bot.is_test = True bot.nico_video_post('mbaacc 馬場', prev_datetime)