Django/gevent socket.IO with redis pubsub. Where do I put things?
问题 I have an isolated python script that simply captures data from Twitter's streaming API and then on the receipt of each message, using redis pubsub it publishes to the channel "tweets". Here is that script: def main(): username = "username" password = "password" track_list = ["apple", "microsoft", "google"] with tweetstream.FilterStream(username, password, track=track_list) as stream: for tweet in stream: text = tweet["text"] user = tweet["user"]["screen_name"] message = {"text": text, "user"