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) send_topic(web_url, book_dir, mapping_path)