Coder Social home page Coder Social logo

csdn-blog-export's Introduction

CSDN 博客导出工具

一个用python2.7写的博客导出工具,导出为markdown或者html。

使用

依赖

Python 2.7
	beautifulsoup4

此外,在导出markdown格式的时候使用了开源项目html2text

使用方法

main.py -u <username> [-f <format>] [-p <page>] [-o <outputDirectory>]
	<format>: html | markdown,缺省为markdown
	<page>为导出特定页面的文章,缺省导出所有文章
	<outputDirectory>暂不可用

拓展:for hexo

以下为hexo日志用户提供

使用main.py抓取html、md文件之后,通过postprocess_for_hexo.py可转换成hexo日志格式的md文件

python postprocess_for_hexo.py
postprocess_for_hexo.py文件中,mdPath表示md文件目录,htmlPath为html文件目录,outPath为转换后hexo的md文件目录

Example

如果想导出http://blog.csdn.net/cecesjtu的文章,格式为markdown,命令为:

./main.py -u cecesjtu -f markdown
or
./main.py -u cecesjtu

格式为html,命令为:

./main.py -u cecesjtu -f html

转换为hexo日志格式,命令为:

python postprocess_for_hexo.py

To Do

  1. 导出到指定目录

Licence

GPLv3

csdn-blog-export's People

Contributors

aleiq avatar gaocegege avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.