Commit 71c83329 authored by litaolemo's avatar litaolemo

update

parent f52ec43f
...@@ -1009,36 +1009,6 @@ query_list = ["双眼皮", ...@@ -1009,36 +1009,6 @@ query_list = ["双眼皮",
] ]
city_list = { city_list = {
"aba":298,
"akesu":299,
"alashan":300,
"aletai":301,
"ali":302,
"anding":303,
"ankang":304,
"anning":305,
"anqing":306,
"anshan":307,
"anshun":308,
"anyang":309,
"aomen":310,
"baicheng":311,
"baise":312,
"baisha":313,
"baishan":314,
"baiyin":315,
"baodi":316,
"baoding":317,
"baoji":318,
"baoshan":319,
"baoting":320,
"baotou":321,
"bayannaoer":322,
"bayinguoleng":323,
"bazhong":324,
"beibei":325,
"beichen":326,
"beihai":327,
"beijing":328, "beijing":328,
"bengbu":329, "bengbu":329,
"benxi":330, "benxi":330,
...@@ -1491,8 +1461,11 @@ headers = { ...@@ -1491,8 +1461,11 @@ headers = {
'x-gm-path': '/60358/', 'x-gm-path': '/60358/',
'X-GM-Rpc-Method': 'rims/search/cpt_service', 'X-GM-Rpc-Method': 'rims/search/cpt_service',
} }
# 正式
rds = redis.StrictRedis.from_url("redis://:XfkMCCdWDIU%ls$h3@172.16.50.159:6379", decode_responses=True) rds = redis.StrictRedis.from_url("redis://:XfkMCCdWDIU%ls$h3@172.16.50.159:6379", decode_responses=True)
# 测试
# rds = redis.StrictRedis.from_url("redis://172.18.51.17:6379/21", decode_responses=True)
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:
...@@ -1510,12 +1483,16 @@ for query in query_list: ...@@ -1510,12 +1483,16 @@ for query in query_list:
(city,str(res),city_list[city],str(res),city_list[city]) (city,str(res),city_list[city],str(res),city_list[city])
} }
# print(data) # print(data)
# 正式
response = requests.post('http://172.16.50.10:8170/v1/batch', headers=headers, data=data) response = requests.post('http://172.16.50.10:8170/v1/batch', headers=headers, data=data)
# 测试
# response = requests.post('http://rims.paas-develop.env/v1/batch', headers=headers, data=data)
data = json.dumps(response.json()) data = json.dumps(response.json())
time.sleep(0.2) time.sleep(0.1)
print(key) print(key)
rds.set(key,data) rds.set(key,data)
except: except Exception as e:
print(e)
continue 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