diff --git a/main.py b/main.py index d827e29f15277ab8becbf01b2acf24f6abdf30f1..0e1067fac2ca008ccc6ac4c97e5140a24a067591 100644 --- a/main.py +++ b/main.py @@ -11,4 +11,9 @@ if __name__ == "__main__": print('开始向社区发帖') book_dir = 'data/{}/'.format(key) mapping_path = 'data/{}.json'.format(key) - # send_topic(web_url, book_dir, mapping_path) \ No newline at end of file + send_topic_request_param = { + "cateId": 20964, + "communityId": 3824, + "loginUserName": "BBS_Assistant" + } + send_topic(web_url, book_dir, mapping_path, send_topic_request_param) \ No newline at end of file diff --git a/src/ebook/community.py b/src/ebook/community.py index 85176e0e0b52cd2b4e4fd2200218baac5cfd1217..fc087658eb4c8d27f42f42c6c81487a4e50db78a 100644 --- a/src/ebook/community.py +++ b/src/ebook/community.py @@ -65,7 +65,7 @@ def post(url, params, retry=3, headers=None): raise error -def send_topic(web_url, book_dir, mapping_path): +def send_topic(web_url, book_dir, mapping_path, send_topic_request_param): data_dir = 'data' # web_url = "https://codechina.csdn.net/csdn/book_code_c798a5992a654857867ec15660e1c32a/-/blob/master/" request_url = 'http://ccloud.internal.csdn.net/v1/internal/community/content/sendTopic' @@ -99,12 +99,9 @@ def send_topic(web_url, book_dir, mapping_path): send_topic_request_param = { "type": "long_text", - "cateId": 20967, "content": topic_content, "topicTitle": topic_title, "mdContent": topic_content, - "communityId": 3823, - "loginUserName": "BBS_Assistant", "bizNo": "ebook" }