main.py 791 字节
Newer Older
ToTensor's avatar
ToTensor 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
from src.ebook.extract_book_code import extract_code
from src.ebook.community import send_topic

if __name__ == "__main__":
    book_mapping = {"零基础学机器学习": "b88b00f6ad14402ea66695d6809614da"}
    for key in book_mapping.keys():
        extract_code(book_mapping)
        web_url = 'https://gitcode.net/csdn/content/book_code_{}/-/tree/master/'.format(
            book_mapping[key])
        print('-------' * 20)
        print('开始向社区发帖')
        book_dir = 'data/{}/'.format(key)
        mapping_path = 'data/{}.json'.format(key)
ToTensor's avatar
ToTensor 已提交
14 15 16 17 18 19
        send_topic_request_param = {
            "cateId": 20964,
            "communityId": 3824,
            "loginUserName": "BBS_Assistant"
        }
        send_topic(web_url, book_dir, mapping_path, send_topic_request_param)