changeset 7:dfbb21128332

merge commit
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 25 Nov 2010 13:09:23 -0800
parents 3cb8ad35fe62 (current diff) da132a64926e (diff)
children 76b8f41da4cf
files bitsytweet/__init__.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/bitsytweet/__init__.py
+++ b/bitsytweet/__init__.py
@@ -1,27 +1,32 @@
 """
-BitsyTweet
+BitsyTweet - tweet your bitsyblog entries (horrid, I know)
 """
 
 import sys
 import twitter
 
 class BitsyTweet(object):
 
   def __init__(self, bitsyblog, username, password):
     self.bitsyblog = bitsyblog
     self.username = username
     self.password = password
     self.api = twitter.Api(username=self.username, password=self.password) 
 
   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)
+      print 'Tweeting: %s' % tweet
+      try:
+        self.api.PostUpdate(tweet)
+      except Exception, e:
+        print >> sys.stderr, "Couldn't tweet %s (%s)" % (url, e)
+      print '</tweet>'
 
 def main(args=sys.argv[1:]):
   """debugging front-end for BitstTweet"""
   
   usage = "%prog [options] tweet"
   from optparse import OptionParser
   parser = OptionParser(usage=usage)
   parser.add_option('-u', '--username',