新增夺宝榜单导出脚本
This commit is contained in:
31
python/peko_seize_treasure_rank_value.py
Normal file
31
python/peko_seize_treasure_rank_value.py
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# pip3 install redis
|
||||||
|
|
||||||
|
import redis
|
||||||
|
import json
|
||||||
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
|
|
||||||
|
res = None
|
||||||
|
|
||||||
|
def connect():
|
||||||
|
res = redis.StrictRedis(host='172.22.0.8', port=6379, db=0, password='pc8DphhaXwTe2jyv')
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
|
def handle_keys():
|
||||||
|
try:
|
||||||
|
members = res.zrange('peko:seize_treasure:rank:value:2023-10-24', 0, -1, withscores=True)
|
||||||
|
for m in members:
|
||||||
|
uid = m[0].decode('utf-8')
|
||||||
|
score = m[1]
|
||||||
|
print(uid, ',', score)
|
||||||
|
except Exception as e:
|
||||||
|
print("handle_keys error.", e)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
res = connect()
|
||||||
|
if res is None:
|
||||||
|
print("redis connect is error.")
|
||||||
|
else:
|
||||||
|
print("redis connect is success.")
|
||||||
|
handle_keys()
|
Reference in New Issue
Block a user