public
Description: A twisted client for twitter-like APIs.
Homepage:
Clone URL: git://github.com/dustin/twitty-twister.git
dustin (author)
Tue Jun 23 00:54:57 -0700 2009
commit  a4e839056a778987969c9e2d70ee76b3045ef289
tree    5ec896e6036413a247fc942e23c5c03e21338324
parent  613cb7b73d16577392bcb8e39ae4b63e86bfa9a7
twitty-twister / example / dms.py
100755 24 lines (15 sloc) 0.479 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
#!/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], '..', 'lib'))
sys.path.append('lib')
 
from twisted.internet import reactor, protocol, defer, task
 
import twitter
 
def gotEntry(msg):
    print "Got a entry from %s: %s" % (msg.sender_screen_name, msg.text)
 
twitter.Twitter(sys.argv[1], sys.argv[2]).direct_messages(gotEntry).addBoth(
    lambda x: reactor.stop())
 
reactor.run()