Mercurial > hg > bitsytweet
annotate bitsytweet/__init__.py @ 2:f0ee545bba37
more stubbing of API
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 07 Jul 2010 16:11:34 -0700 |
parents | b003ae6978fe |
children | 50f77774a20a |
rev | line source |
---|---|
0
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
1 """ |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
2 BitsyTweet |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
3 """ |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
4 |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
5 import twitter |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
6 |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
7 class BitsyTweet(object): |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
8 |
2 | 9 def __init__(self, bitysblog, username, password): |
10 self.bitsyblog = bitsyblog | |
0
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
11 self.username = username |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
12 self.password = password |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
13 self.api = twitter.Api(username=self.username, password=self.password) |
56a9fb9ad9b4
initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
14 |
2 | 15 def __call__(self, blog_entry): |
16 if blog_entry.privacy == 'public': # only tweet public blogs | |
17 tweet = '%s : %s' % (blog_entry.snippet(), 'foo') | |
18 self.api.PostUpdate(self.username, self.password, ) |