Пример #1
0
        pipe.zadd(r_SS_DASH_USD_PRICE, epoch00,
                  str(epoch00) + ':' + str(dashusd['avg']))
        response = pipe.execute()

    except Exception as e:
        print(e.args[0])
        pass

    # ISS
    try:
        streamer = Streamer(bucket_name='ticker',
                            bucket_key='xxxxx',
                            access_key='xxxxxx',
                            buffer_size=50)
        streamer.log_object_no_ub(dashbtc,
                                  key_prefix="dashbtc_",
                                  epoch=epoch00)
        streamer.log_object_no_ub(dashusd,
                                  key_prefix="dashusd_",
                                  epoch=epoch00)
        streamer.close()

    except Exception as e:
        print(e.args[0])
        pass

except Exception as e:
    print(e.args[0])
    sys.exit()

except KeyboardInterrupt:
Пример #2
0
    # redis
    try:
        pipe = r.pipeline()
        pipe.zadd(r_SS_BTC_PRICE, epoch00,
                  str(epoch00) + ':' + str(btcusd['avg']))
        pipe.set(r_KEY_BTC_PRICE, json.dumps(btcusd, sort_keys=True))
        response = pipe.execute()

    except Exception as e:
        print(e.args[0])
        pass

    # ISS
    try:
        streamer = Streamer(bucket_name='ticker',
                            bucket_key='xxxxxx',
                            access_key='xxxxxx',
                            buffer_size=50)
        streamer.log_object_no_ub(btcusd, key_prefix="btcusd_", epoch=epoch00)
        streamer.close()

    except Exception as e:
        print(e.args[0])
        pass

except Exception as e:
    print(e.args[0])

except KeyboardInterrupt:
    sys.exit()