Commit 2c8b099d authored by litaolemo's avatar litaolemo

update

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