Commit 54392b2a authored by wang's avatar wang

ws 测试

parent 3d1dbe79
...@@ -36,17 +36,18 @@ db = client.env ...@@ -36,17 +36,18 @@ db = client.env
def get_random_one(): def get_random_one():
query = { query = {
'env.funcs': {'$ne': None}, 'env.funcs': {'$ne': None},
'env.fontsres': {'$ne': None}, 'env.fontsres': {'$ne': None},
'env.matchmedias': {'$ne': None}, 'env.matchmedias': {'$ne': None},
'env.navigatorparams.platform': 'MacIntel', 'env.navigatorparams.platform': 'MacIntel',
# 'env.navigatorparams.platform': 'Win32', # 'env.navigatorparams.platform': 'Win32',
"env.navigatorparams.vendor": "Google Inc.", "env.navigatorparams.vendor": "Google Inc.",
'env.useragentdata.highvalue.uafullversion': {'$ne': ""} 'env.useragentdata.highvalue.uafullversion': {'$ne': ""}
} }
res = list(db.env_shape.aggregate([ res = list(db.env_shape.aggregate([
{'$match': query}, {'$match': query},
{'$sample': {'size': 1}} {'$sample': {'size': 1}},
{'$sort': {'updatetime': 1}}
])) ]))
path = f'/tmp/{str(res[0]["_id"])}' path = f'/tmp/{str(res[0]["_id"])}'
with open(path, 'w') as f: with open(path, 'w') as f:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment