I want to print the time which a User follow another user

python
tweepy
twitter4j
sitestreams

#1

How can I print the followed event time, this is what I have but I am getting no output

from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream

#Twitter API credentials
consumer_key = ''
consumer_secret = ''
access_token = ''
access_secret = ''

class StdOutListener(tweepy.StreamListener):
    """ A listener handles tweets that are received from the stream.
    This is a basic listener that just prints received tweets to stdout.
    """
    def on_event(self, event):
            if event.event == 'follow':
            time = event.created_at
            source_user = event.source
            target_user = target_user
            some_process(time, sousrce_user, target_user)
            print(event.created_at)
   
if __name__ == '__main__':
    l = StdOutListener()
    auth = OAuthHandler(consumer_key, consumer_secret)
    auth.set_access_token(access_token, access_secret)
    stream = tweepy.Stream(auth, l)
    stream.sitestream(follow=[4148405415,410868298])

How to find the userID or Screen Name of a given tweetID
#2

Please ask a proper question, describing exactly what you are trying to do, format your question nicely. Use fenced code block for code. If you don’t know how to do this, please check this Forum help, as else your question is really unreadable and it’s unlikely you will get any answers.
Thanks!


#3

Sorry, I hope my question is now clear