dustin / twitty-twister

A twisted client for twitter-like APIs.

This URL has Read+Write access

twitty-twister / example / search.py
100644 24 lines (15 sloc) 0.443 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], '..', 'twittytwister'))
sys.path.append('twittytwister')
 
from twisted.internet import reactor, protocol, defer, task
 
import twitter
 
def gotEntry(msg):
    print "Got a entry: ", msg.title
 
twitter.Twitter().search(sys.argv[1], gotEntry).addBoth(
    lambda x: reactor.stop())
 
reactor.run()