1234567891011121314151617181920212223242526272829303132 |
- """
- @author: luojunhui
- """
- import requests
- from config import accountBaseInfo
- from tqdm import tqdm
- def update_articles(gh_id):
- """
- :param gh_id:
- :return:
- """
- url = "http://192.168.100.31:6062/article_crawler"
- headers = {"Content-Type": "application/json"}
- body = {"ghId": gh_id}
- response = requests.request("POST", url=url, headers=headers, json=body)
- print(response.json())
- if __name__ == '__main__':
- gh_id_set = set()
- for key in accountBaseInfo:
- value = accountBaseInfo[key]['ghId']
- gh_id_set.add(value)
- for gh_id in tqdm(gh_id_set):
- update_articles(gh_id)
|