annotate bitsytweet/__init__.py @ 1:b003ae6978fe

make api look like it should
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 07 Jul 2010 13:57:47 -0700
parents 56a9fb9ad9b4
children f0ee545bba37
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
56a9fb9ad9b4 initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 def __init__(self, username, password):
56a9fb9ad9b4 initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 self.username = username
56a9fb9ad9b4 initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 self.password = password
56a9fb9ad9b4 initial commit of bitsytweet (not yet functional)
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 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
13
1
b003ae6978fe make api look like it should
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
14 def __call__(self, blog):
b003ae6978fe make api look like it should
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
15 if blog.privacy == 'public': # only tweet public blogs
b003ae6978fe make api look like it should
Jeff Hammel <jhammel@mozilla.com>
parents: 0
diff changeset
16 self.api.PostUpdate(self.username, self.password, '')