rank_dev.py 638 B

12345678910111213141516171819202122
  1. import json
  2. import requests
  3. import time
  4. url = "http://192.168.100.31:8179/score_list"
  5. with open("body.json") as f:
  6. data = json.loads(f.read())
  7. body = json.loads(data['data'])
  8. body['strategy'] = "ArticleRankV2"
  9. body['publishNum'] = 4
  10. # body['accountName'] = "指尖奇文"
  11. headers = {"Content-Type": "application/json"}
  12. a = time.time()
  13. response = requests.post(url=url, headers=headers, json=body)
  14. b = time.time()
  15. print(json.dumps(response.json(), ensure_ascii=False, indent=4))
  16. print(b - a)
  17. # for res in response.json()['data']['rank_list']:
  18. # print(res['title'], res['producePlanName'], res['score'], res['crawlerViewCount'])