保存贴吧的精品文章, 转化为 markdown 格式.
使用 npm
或 yarn
安装
yarn add @vutex/wapp2md
npm install @vutex/wapp2md
然后输入帖子 id
就能下载并转换为 markdown
文件了.
import { writeFileSync } from 'fs'
import { parserPage } from '@vutex/wapp2md'
parseTiezi(5544838611).then($ => { writeFileSync(`${__dirname}/5544838611.md`, $) })
网页: https://tieba.baidu.com/p/5544838611
脚本: https://github.com/uupers/save-tieba/blob/master/projects/wapp2md/test/page.ts
效果: https://github.com/uupers/save-tieba/blob/master/projects/wapp2md/test/5544838611.md
获取贴吧精品编号:
parseTieba('数学').then($ => { writeFileSync(`${__dirname}/数学吧.json`, JSON.stringify($, null, 4)) })
效果: https://github.com/uupers/save-tieba/blob/master/projects/wapp2md/test/数学吧.json