Mercurial > hg > bitsytweet
changeset 4:ed3c5f7ba348
print to stderr instead of dying on exceptions
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 26 Jul 2010 07:08:37 -0700 |
parents | 50f77774a20a |
children | da132a64926e |
files | bitsytweet/__init__.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/bitsytweet/__init__.py Thu Jul 08 11:13:43 2010 -0700 +++ b/bitsytweet/__init__.py Mon Jul 26 07:08:37 2010 -0700 @@ -1,7 +1,8 @@ """ -BitsyTweet +BitsyTweet - tweet your bitsyblog entries (horrid, I know) """ +import sys import twitter class BitsyTweet(object): @@ -15,4 +16,7 @@ def __call__(self, blog_entry, url): if blog_entry.privacy == 'public': # only tweet public blogs tweet = '%s : %s' % (blog_entry.snippet(), url) - self.api.PostUpdate(tweet) + try: + self.api.PostUpdate(tweet) + except Exception, e: + print >> sys.stderr, "Couldn't tweet %s (%s)" % (url, e)