12345678910111213141516171819202122232425262728293031 |
- """
- @author: luojunhui
- """
- import time
- import requests
- def update_articles(gh_id):
- """
- :param gh_id:
- :return:
- """
- # url = "http://47.98.136.48:6060/article_crawler"
- url = "http://localhost:6060/article_crawler"
- headers = {"Content-Type": "application/json"}
- body = {"ghId": gh_id}
- response = requests.request("POST", url=url, headers=headers, json=body, timeout=120)
- print(response.status_code)
- print("info", response.text)
- print(response.json())
- # gh_id_list = ["gh_ac43e43b253b", "gh_93e00e187787", 'gh_68e7fdc09fe4', 'gh_77f36c109fb1', 'gh_7c66e0dbd2cf', 'gh_b181786a6c8c']
- #
- # for item in gh_id_list:
- # try:
- # update_articles(item)
- # time.sleep(5)
- # except Exception as e:
- # print(e)
|