view bitsytweet/__init__.py @ 3:50f77774a20a

made tweeting work
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 08 Jul 2010 11:13:43 -0700
parents f0ee545bba37
children ed3c5f7ba348 3cb8ad35fe62
line wrap: on
line source

"""
BitsyTweet
"""

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)