dustin / twitty-twister

A twisted client for twitter-like APIs.

This URL has Read+Write access

twitty-twister / example / list-followers.py
100644 28 lines (18 sloc) 0.537 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
"""
 
Copyright (c) 2008 Dustin Sallings <dustin@spy.net>
"""
 
import os
import sys
 
sys.path.append(os.path.join(sys.path[0], '..', 'twittytwister'))
sys.path.append('twittytwister')
 
from twisted.internet import reactor, protocol, defer, task
 
import twitter
 
def gotUser(user):
    print "User: %s (%s)" % (user.name, user.screen_name)
 
un=None
if len(sys.argv) > 3:
    un=sys.argv[3]
 
twitter.Twitter(sys.argv[1], sys.argv[2]).list_followers(gotUser, un).addBoth(
    lambda x: reactor.stop())
 
reactor.run()