Example #1
0
        import shutil
        shutil.rmtree('logocache', ignore_errors=True)
        shutil.rmtree('badgecache', ignore_errors=True)
        shutil.rmtree('emotecache', ignore_errors=True)
        shutil.rmtree('profile_images', ignore_errors=True)

    if args.testtwitch:
        from twitch.api import v3 as twitch
        featured_streams = twitch.streams.featured(limit=5)['featured']
        for x in featured_streams:
            config['twitch_channels'].append(x['stream']['channel']['name'])

    try:
        console = TwitchChatDisplay(config['screen_width'], config['screen_height'])
        console.display_message("Loading twitch_api manager")
        thandler = twitchevents(config['twitch_channels'])
        thandler.subscribe_new_follow(console.new_followers)
        thandler.subscribe_viewers_change(console.new_viewers)
        console.display_message("Loading twitch_message handler")
        tirc = twitch_chat(config['twitch_username'], config['twitch_oauth'], config['twitch_channels'],
                           config['client_id'])
        tirc.subscribeChatMessage(console.new_twitchmessage)
        tirc.subscribeNewSubscriber(console.new_subscriber)
        ytchat = None
        if 'youtube_enabled' in config:
            if config['youtube_enabled']:
                console.display_message("Grabbing youtube chat id")
                chatId = None
                if args.testyoutube:
                    from youtubechat import get_top_stream_chat_ids
                    chatId = get_top_stream_chat_ids("oauth_creds")[0]
 def load_twitchevents(self, channel):
     logger.info("Loading twitchevents for {0}".format(channel))
     self.twitchevents = twitchevents([channel])
 def load_twitchevents(self, channel):
     logger.info("Loading twitchevents for {0}".format(channel))
     self.twitchevents = twitchevents([channel])