Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def checkForNewFollower(channel, q_twitchbeagle, logger):
try:
followers = channels.getChannelFollowers(channel)
latestDisplay = followers["follows"][0]['user']['display_name'].encode(
'utf-8')
latestUsername = followers["follows"][0]['user']['name']
latestId = followers["follows"][0]['user']['_id']
print("FOLLOWCHECK", latestDisplay, latestUsername, latestId)
event = {
'eventType' : 'currency',
'event' : 'follower %d %s %s' %(latestId,
latestUsername, latestDisplay)
}
q_twitchbeagle.put(event)
except Exception,e:
logger.error(str(e))
logger.error(traceback.format_exc())