node-huaban

1.4.0 • Public • Published

node-huaban

花瓣(http://huaban.com) 画板下载器

npm version node version license

安装

$ npm i node-huaban -g

使用

$ huaban
  huaban board downloader v0.0.1

    Usage:
      huaban [options] <board_url>

    Options:
      -h,--help         输出此帮助信息
      -c,--concurrency  同时最大下载数量,默认10
      -t, --timeout     超时, 单位分, 默认1分钟 = 60 * 1000毫秒
      --max-times       重试次数, 默认5

    Example:
      huaban http://huaban.com/boards/17324249/ -c 10

API

const HuabanBoard = require('node-huaban');

constructor

const board = new HuabanBoard(url); // url 是画板地址

init

board.init(); // return a Promise, when all pins & title are ready
 
// normally, use with co
yield board.init();

运行 init 之后, board会包含以下字段:

  • board.title board的名称
  • board.pins 图片, 包含地址src & 文件类型 ext

downloadBoard

下载所有图片

yield board.downloadBoard(concurrency, timeout, maxTimes);

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.4.0
    0
    • latest

Version History

Package Sidebar

Install

npm i node-huaban

Weekly Downloads

0

Version

1.4.0

License

MIT

Unpacked Size

9.37 kB

Total Files

6

Last publish

Collaborators

  • magicdawn