def visit_num_increment(cls, key_name):
     conn.hset(key_name, 'visit_num',
               int(conn.hget(key_name, 'visit_num').decode()) + 1)
 def set_target_url(cls, key_name, url):
     conn.hset(key_name, 'target_url', url[1:])
 def update_last_visit_time(cls, key_name):
     conn.hset(key_name, 'last_visit_time', time.time())
 def __init__(self, key_name):
     conn.hset(key_name, 'visit_num', 1)
     conn.hset(key_name, 'last_visit_time', time.time())
     conn.hset(key_name, 'target_url', '')