import redis
import time

r = redis.Redis(host='db.ptt.cx', port=6379, db=1)
p = r.pubsub(ignore_subscribe_messages=True)
p.subscribe('q_hhh_seo')

while True:
    message = p.get_message()
    if message:
        print(message['data'].decode('utf-8'))
    time.sleep(0.001)  # be nice to the system :)

