import redis
import json
import datetime

def make_queue():
    native = "58,59,60,61,62,63,64,65"
    r.hset(key,"native_queue",native)
    nearby = '88,89,90,91,92,93,94,95'
    r.hset(key, "nearby_queue", nearby)
    nation = '128,129,130,131,132,133,134,135,136,137,138,139'
    r.hset(key, "nation_queue", nation)
    megacity = '150,151,152,153,154,155,156,157,158,159'
    r.hset(key, "megacity_queue", megacity)



def user_portr():
    key = 'user_portrait_recommend_diary_queue:device_id:%s:%s' % \
          (device_id, datetime.datetime.now().strftime('%Y-%m-%d'))
    r.hset(key, "cursor", "0")
    r.hset(key, "len_cursor", "0")
    r.hset(key, "cpc_queue", json.dumps([58, 59, 60, 61, 62, 63, 64, 65]))
    r.hset(key, "diary_queue", json.dumps([88, 89, 90, 91, 92, 93, 94, 95]))
    print(r.hgetall(key))


if __name__ == "__main__":
    device_id = "860445048868273"
    user_portr()

