from requests_oauthlib import OAuth1
import urllib3
-from tweepy.api import API
from tweepy.error import TweepError
from tweepy.models import Status
class StreamListener:
- def __init__(self, api=None):
- self.api = api or API()
-
def on_connect(self):
"""Called once connected to streaming server.
data = json.loads(raw_data)
if 'in_reply_to_status_id' in data:
- status = Status.parse(self.api, data)
+ status = Status.parse(None, data)
return self.on_status(status)
if 'delete' in data:
delete = data['delete']['status']