Steamer not getting any data


#1

I’m not too sure why my Streamer isn’t working. I’ve tried everything I can think of! Any help would be appreciated:

import tweepy
from tweepy import OAuthHandler
from tweepy import Stream
from tweepy.streaming import StreamListener
consumer_key = 'XXXXXX’
consumer_secret = 'XXXXXX’
access_token = ‘XXXXXX’
access_secret = ‘XXXXXX’
auth = OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_secret)
api = tweepy.API(auth)
from tweepy import Stream
from tweepy.streaming import StreamListener
class MyListener(StreamListener):
def on_data(self, data):
try:
with open(‘python.json’, ‘a’) as f:
f.write(data)
return True
except BaseException as e:
print(“Error on_data: %s” % str(e))
return True
def on_error(self, status):
print(status)
return True
twitter_stream = Stream(auth, MyListener())
twitter_stream.filter(track=[’#bitcoin’])


#2

What errors are you seeing?


#3

I’m not seeing any errors. It just runs and looks like the streamer is open, but nothing ever pops up.