2.2.3 • Published 8 years ago
spiderclient v2.2.3

Spiderclient
A simple command-line client for Spiderman
Install
npm i -g spiderclientUsage
spider
spider
Usage: [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
add [options] <path> add a spider to spiderman
config [options] [name] check or update configuration
info <spider> get the info of a spider
ls list all spiders
ps list all running spiders
rm [options] <spider> delete a spider
run <spider> run a spider
stop <spider> stop a spider
update [options] <spider> update a spider\'s configurationspider add
spider add -h
Usage: add [options] <path>
add a spider to spiderman
Options:
-n, --name <name> spider\'s name
-i, --interval <interval> interval between repeatedly call, 0 for once
-m, --maxtime <maxtime> max time for spider to run at once
-h, --help output usage informationpathis the path of your spider. Ifpathis a directory, there should be anindex.jsin it.
Example
spider add test.js
# index.js in it
spider add ./dirintervalandmaxtimecan be either integer(ms) or string.
Example
# 5000ms
spider add a.js -i 5000
# human readable string
spider add a.js -i 1h30m
spider add a.js -i 1day30m
spider add a.js -i 100s50msTime Keywords:
ms,milli,millisecond,milliseconds- will parse to millisecondss,sec,secs,second,seconds- will parse to secondsm,min,mins,minute,minutes- will parse to minutesh,hr,hrs,hour,hours- will parse to hoursd,day,days- will parse to days
spider config
spider config -h
Usage: config [options] [name]
check or update configuration
Options:
-s, --set <value> update with new value
-h, --help output usage informationExample
# show all
spider config
# show host
spider config host
# set host
spider config host -s 127.0.0.1
# set both host and port
spider config host -s localhost:1215spider info
spider info -h
Usage: info [options] <spider>
get the info of a spider
Options:
-h, --help output usage informationExample
# use id
spider info 1
# use name
spider info spidernamespider ls
spider ls -h
Usage: ls [options]
list all spiders
Options:
-h, --help output usage informationspider ps
spider ps -h
Usage: ps [options]
list all running spiders
Options:
-h, --help output usage informationspider rm
spider rm -h
Usage: rm [options] <spider>
delete a spider
Options:
-f, --force forced to delete even the spider is running
-h, --help output usage informationExample
# delete a stopped spider
spider rm 1
# delete a running spider
spider rm spidername -fspider start
spider start -h
Usage: start [options] <spider>
start a spider
Options:
-h, --help output usage informationspider stop
spider stop -h
Usage: stop [options] <spider>
stop a spider
Options:
-h, --help output usage informationspider update
spider update -h
Usage: update [options] <spider>
update a spider's configuration
Options:
-i, --interval <interval> interval between repeatedly call, 0 for once
-m, --maxtime <maxtime> max time for spider to run at once
-h, --help output usage informationExample:
spider update 1 -i 12000
spider update spidername -m 0
spider update 2 -i 0 -m 0LICENSE
MIT