1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- """
- @author: luojunhui
- """
- import json
- import time
- import requests
- from concurrent.futures.thread import ThreadPoolExecutor
- def score_list(account):
- """
- url = "http://192.168.100.31:8179/score_list"
- url1 = "http://47.98.154.124:6060/score_list"
- # url1 = "http://localhost:6060/score_list"
- url2 = "http://192.168.100.31:6062/score_list"
- :param account:
- :return:
- """
- url2 = "http://61.48.133.26:6061/score_list"
- body = {
- "gh_id_list": [
- "gh_02f5bca5b5d9"
- ],
- "text_list": [
- "在俄罗斯买好地了,却发现没有公路、码头、仓储、燃气管道……”",
- "被霸占15年后成功收回,岛礁资源超100万吨,曾遭到美菲联手抢夺",
- "感人!河南姐弟被父母遗弃,7岁弟弟带着姐姐看病:别怕,以后我养",
- "山东26岁女子产下罕见“4胞胎”,丈夫却突然消失,婆婆:养不起"
- ],
- "interest_type": "account_avg",
- "sim_type": "avg",
- "rate": 0.1,
- "view_count_filter": 1000
- }
- response = requests.post(url=url2, headers={}, json=body).json()
- print(json.dumps(response, ensure_ascii=False, indent=4))
- return response
- if __name__ == '__main__':
- # a = time.time()
- # with ThreadPoolExecutor(max_workers=100) as pool:
- # pool.map(score_list, ["生活良读"] * 1)
- # b = time.time()
- # print(b - a)
- a = time.time()
- res = score_list("生活情感叁读")
- b = time.time()
- print(b - a)
|