提交 0c2922fe 编写于 作者: ToTensor's avatar ToTensor

extract code success

上级 2c53996a
...@@ -11,4 +11,9 @@ if __name__ == "__main__": ...@@ -11,4 +11,9 @@ if __name__ == "__main__":
print('开始向社区发帖') print('开始向社区发帖')
book_dir = 'data/{}/'.format(key) book_dir = 'data/{}/'.format(key)
mapping_path = 'data/{}.json'.format(key) mapping_path = 'data/{}.json'.format(key)
# send_topic(web_url, book_dir, mapping_path) send_topic_request_param = {
\ No newline at end of file "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
...@@ -65,7 +65,7 @@ def post(url, params, retry=3, headers=None): ...@@ -65,7 +65,7 @@ def post(url, params, retry=3, headers=None):
raise error 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' data_dir = 'data'
# web_url = "https://codechina.csdn.net/csdn/book_code_c798a5992a654857867ec15660e1c32a/-/blob/master/" # web_url = "https://codechina.csdn.net/csdn/book_code_c798a5992a654857867ec15660e1c32a/-/blob/master/"
request_url = 'http://ccloud.internal.csdn.net/v1/internal/community/content/sendTopic' 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): ...@@ -99,12 +99,9 @@ def send_topic(web_url, book_dir, mapping_path):
send_topic_request_param = { send_topic_request_param = {
"type": "long_text", "type": "long_text",
"cateId": 20967,
"content": topic_content, "content": topic_content,
"topicTitle": topic_title, "topicTitle": topic_title,
"mdContent": topic_content, "mdContent": topic_content,
"communityId": 3823,
"loginUserName": "BBS_Assistant",
"bizNo": "ebook" "bizNo": "ebook"
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册