1
from tweepy import OAuthHandler
from tweepy import StreamListener

class listener(StreamListener):

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

    def on_error(self, status):
        print (status)

auth = OAuthHandler(ckey, csecret)
auth.set_access_token(atoken, asecret)

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

The error I am getting is twitterStream = Stream(auth, listener()) NameError: name 'Stream' is not defined. This example is from the pythonprogramming.net website. I am not sure what I am to assign to 'Stream'. I removed my authentication tokens and others from this but do have them.

Yepram Yeransian
  • 321
  • 1
  • 14

1 Answers1

0

from tweepy import Stream

This will fix the issue.

Yepram Yeransian
  • 321
  • 1
  • 14