comparison 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
comparison
equal deleted inserted replaced
2:f0ee545bba37 3:50f77774a20a
4 4
5 import twitter 5 import twitter
6 6
7 class BitsyTweet(object): 7 class BitsyTweet(object):
8 8
9 def __init__(self, bitysblog, username, password): 9 def __init__(self, bitsyblog, username, password):
10 self.bitsyblog = bitsyblog 10 self.bitsyblog = bitsyblog
11 self.username = username 11 self.username = username
12 self.password = password 12 self.password = password
13 self.api = twitter.Api(username=self.username, password=self.password) 13 self.api = twitter.Api(username=self.username, password=self.password)
14 14
15 def __call__(self, blog_entry): 15 def __call__(self, blog_entry, url):
16 if blog_entry.privacy == 'public': # only tweet public blogs 16 if blog_entry.privacy == 'public': # only tweet public blogs
17 tweet = '%s : %s' % (blog_entry.snippet(), 'foo') 17 tweet = '%s : %s' % (blog_entry.snippet(), url)
18 self.api.PostUpdate(self.username, self.password, ) 18 self.api.PostUpdate(tweet)