<commit_before>from canis import siriusxm, spotify, oauth

def main():
    try:
        current = siriusxm.get_currently_playing('siriusxmu')
        spotify_id = spotify.id_for_song(current)
        print(current, spotify_id)
    except Exception, e:
        print "Error {}".format(e)

if __name__ == "__main__":
    oauth.app.run()
    main()
<commit_msg>Restructure error handling a bit<commit_after>from time import sleep
from datetime import datetime
from canis import siriusxm, spotify, oauth

def main():
    channels = ['siriusxmu', 'altnation']
    while True:
        if oauth.expiration > datetime.utcnow():
            oauth.refresh()
        for channel in channels:
            try:
                current = siriusxm.get_currently_playing(channel)
                spotify_id = spotify.id_for_song(current)
                print '{} - {}'.format(current, spotify_id)
            except Exception, e:
                print "Error {}".format(e)
        sleep(60)

if __name__ == "__main__":
    oauth.app.run()
    main()

{'fraction_non_alphanumeric': 0.1072463768115942, 'fraction_numerical': 0.001932367149758454, 'mean_word_length': 2.4882154882154883, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4460937', 'n_tokens_mistral': 334, 'n_tokens_neox': 323, 'n_words': 79}