views:

252

answers:

2

Hi there

i've got some problems with the tweepy api.

I'm just tryin to write a little app that gets me a stream of statuses of one user (ore more), but one would be fine to start with ;-)

now: my code is like that:

    def main():
       config = ConfigParser.ConfigParser()
       config.read('twitter.cfg')

       username = config.get('Twitter', 'username')
       password = config.get('Twitter', 'password') 
           listener = StreamWatcherListener()

       stream = tweepy.Stream(username, password, listener, timeout=None)
       stream.filter('132897940')

in StreamWatcherListener I have a method "on_status" that prints the text of a status, whenever a new one arrives (everything seems to work, when I try stream.sample() instead of stream.filter())

the given ID is my testaccount, so whenever I tweet I should get some response in the console....but nothing happens.

when I try

curl -d @following http://stream.twitter.com/1/statuses/filter.json -uAnyTwitterUser:Password

in the terminal as I could find in the twitter api, everything runs fine.

So maybe I make wrong use of the filter()-method?

any suggestions?

-andy

A: 

sorry man...

didn't get it

sa
A: 

ok, i found it out myself

the stream.filter() method needs an array

so i had to code

stream.filter(['1234567'])

et voilà

andy