import gevent.monkey as monkey
monkey.patch_all()

import gevent
import gevent.queue

import zmq.green as zmq

import binascii

import bitcoinrpc.authproxy

def zmqpoller(hash_queue):
    while True:
        msg = socket.recv_multipart()
        topic = str(msg[0])
        body = msg[1]
        hash_queue.put(binascii.hexlify(body))

def rpcrequester(hash_queue):
    with open("bitcoin.conf", "r") as f:
        rpcuser = f.readline().strip("\n")
        rpcpassword = f.readline().strip("\n")

    rpcurl = "http://{}:{}@127.0.0.1:8332".format(rpcuser, rpcpassword)
    handle = bitcoinrpc.authproxy.AuthServiceProxy(rpcurl, None, 500)

    # Check that it's working...
    getinfo = handle.getinfo()

    for txhash in hash_queue:
        tx = handle.getrawtransaction(txhash, 1)
        try:
            outs = [(vout["scriptPubKey"]["addresses"][0], vout["value"]) for vout in tx["vout"]] 
            for out in outs:
                print "{}: {}BTC".format(out[0], out[1])
        except KeyError:
            print "odd tx"
            print tx

        print

if __name__ == "__main__":
    context = zmq.Context()
    socket = context.socket(zmq.SUB)
    socket.setsockopt(zmq.SUBSCRIBE, "hashtx")
    socket.connect("tcp://127.0.0.1:10000")

    hash_queue = gevent.queue.Queue()
    zmq_process = gevent.spawn(zmqpoller, hash_queue)

    try:
        rpcrequester(hash_queue)
    finally:
        socket.close()
        context.term()

@@ -119,16 +119,32 @@
 binascii
+%0Aimport datetime
 %0A%0Aimport
@@ -960,17 +960,28 @@
 rint %22%7B%7D
-:
+ %7B%7D received
  %7B%7DBTC%22.
@@ -987,16 +987,56 @@
 .format(
+datetime.datetime.utcnow().isoformat(), 
 out%5B0%5D, 

Add timestamp, clarify that this is 'received'