Ejemplo n.º 1
0
def handle_reponse(bidname, json):
    bid_info = json['rows'][0]
    if bidname != bid_info['newname']:
        logger.info('%s finish or not start bid', bidname)
        return
    name = 'name: %s' % bidname
    bidder = 'bidder: %s' % bid_info['high_bidder']
    amount = 'amount: %s' % (float(bid_info['high_bid']) / 10000)
    timestamp = int(bid_info['last_bid_time'])
    time_format_str = time.strftime("%F %T %Z", time.localtime(timestamp / 1000000))
    time_str = 'date: %s' % time_format_str
    timestamp = 'time: %s' % timestamp
    result = [name, bidder, amount, time_str, timestamp]
    logger.info(result)
    Notify.notify_status(name, bidder, amount, time_str, timestamp)
Ejemplo n.º 2
0
def get_bindname_info(bidname):
    bid_info = eos_api.get_bindname_info(bidname, url=api)
    if not bid_info:
        return
    name = 'name: %s' % bidname
    bidder = 'bidder: %s' % bid_info['high_bidder']
    amount = 'amount: %s' % (float(bid_info['high_bid']) / 10000)
    timestamp = int(bid_info['last_bid_time'])
    time_format_str = time.strftime("%F %T %Z",
                                    time.localtime(timestamp / 1000000))
    time_str = 'date: %s' % time_format_str
    timestamp = 'time: %s' % timestamp
    result = [name, bidder, amount, time_str, timestamp]
    logger.info(result)
    Notify.notify_status(name, bidder, amount, time_str, timestamp)
Ejemplo n.º 3
0
def notify(*args):
    logger.info(args)
    Notify.notify_status(*args)