TWEEPY STREAM: receive my own timeline tweets

954 views
Skip to first unread message

LORENZO WAVE

unread,
Jan 25, 2014, 7:56:13 AM1/25/14
to twe...@googlegroups.com

I need to catch the tweets I recieve in my timeline from the people I follow.

The code I have is:

*import sys  
import tweepy 
from tweepy import Stream 
from tweepy.streaming import StreamListener

CONSUMER_KEY = 'fgdg'  
CONSUMER_SECRET = 'fdgdfgdf' 
ACCESS_KEY = 'fgdfgd'  
ACCESS_SECRET = 'dfgdfgdfg' 

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)  
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)  
api = tweepy.API(auth)

class listener(StreamListener):

    def on_data(self, data):
        print data
        return True
    def on_error(self, status):
        print status

twitterStream = Stream(auth, listener()) 
twitterStream.filter(track=["order"])*

But this give me the PUBLIC STREAM. I only want MY TIMELINE STREAM

Thanks in advanced

aa1r...@gmail.com

unread,
Feb 24, 2014, 7:24:55 AM2/24/14
to twe...@googlegroups.com
You need to use the userstream method, instead of the filter method. It supports the 'track' parameter, but you'll need to set the 'with' parameter to 'followings' to get the full home timeline.

For more information, look at the docs: https://dev.twitter.com/docs/api/1.1/get/user and https://dev.twitter.com/docs/streaming-apis/parameters#with.

erics...@gmail.com

unread,
Mar 2, 2014, 3:57:14 PM3/2/14
to twe...@googlegroups.com




twitterStream = Stream(auth, listener()) 
twitterStream.userstream("with=following")

Updated your source with the correct parameters for userstream following.

erics...@gmail.com

unread,
Mar 2, 2014, 3:58:17 PM3/2/14
to twe...@googlegroups.com
twitterStream.userstream("with=following")

Aaron Hill

unread,
Mar 3, 2014, 6:20:21 AM3/3/14
to twe...@googlegroups.com, erics...@gmail.com
You want to pass "with" as a parameter, like this:

witterStream.userstream(with="following")
Reply all
Reply to author
Forward
0 new messages