0.0.3 • Published 6 years ago

douban-formatter v0.0.3

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Douban-Formatter

Douban-Formatter is a command line tool to publish rich text format (markdown,etc) on douban. Currently it only support markdown file format.

Prerequisite

node >= 10.8.0

Install

npm i -g douban-formatter

Usage

douban-formatter --title <title> \
    --article_path <path to article> \
    --ck <cookie ck value> \
    --dbcl2 <cookie dbcl2 value>

Or

douban-formatter --config <config.json>
optionsdescription
--title,-tarticle title. Requried
--article_path,-apath to article file. Requried
--introduction,-iarticle introduction. Optional
--privacy,-particle privacy setting. Possible value: public, friend, self Default value is public
--reply, -rReaders could reply the article or not. Possible value: true, false Default value is true
--original,-oIs the article original or not. Possible value: true, false Default value is true
--ck,-cCookie item ck's value. Required.
--dbcl2, -dCookie item dbcl2's value. Required.

How to get Cookie in Chrome

After login into douban. Go to Settings->More Tools->Developer Tools. Select Application Tab and In storage section, find Cookie. find the value of dbcl2 and ck in Cookie.

Why

Douban currently provided very limit support (only Bold, Quote, Subheader, Link) for rich text format and has to use its online editor. If one wants to publish an exisiting article on douban, it have to use douban's online editor to reformat its article which is very painful.

Todo

  • Add support for HTML format
  • Add support for image and video
  • Add support for captcha. (If publish too frequently douban may ask for captcha verifcation)
  • Optimize Authoriztion process (Try to use username and password to login and get cookie)