Commit 2c8b099d authored by litaolemo's avatar litaolemo

update

parent 524cbedd
......@@ -558,7 +558,6 @@ query_list = ["双眼皮",
"鼻头缩小",
"超光子",
"牙贴面",
"",
"铜雀台",
"减肥",
"冰点脱毛",
......@@ -1481,8 +1480,6 @@ city_list = {
"sichuan":755,
"sichuan":756,
"guizhou":757,
}
import requests
import redis
......@@ -1499,7 +1496,10 @@ rds = redis.StrictRedis.from_url("redis://:XfkMCCdWDIU%ls$h3@172.16.50.159:6379"
for query in query_list:
res = json.dumps(query)
for city in city_list:
pass
try:
key = "meigou_" + city + "_" + query
if rds.exists(key):
continue
data = {
'requests': '[{"method": "rims/search/cpt_service", "params": {"sort_with_submission": true, '
'"city_id": "%s", "is_feed": false, "sort_type": 0, "sort_params": {"query": %s,'
......@@ -1512,8 +1512,10 @@ for query in query_list:
# print(data)
response = requests.post('http://172.16.50.10:8170/v1/batch', headers=headers, data=data)
data = json.dumps(response.json())
time.sleep(1)
key = "meigou_" + city + "_" + query
time.sleep(0.2)
print(key)
rds.set(key,data)
except:
continue
# break
\ No newline at end of file
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