Spiderclient
A simple command-line client for Spiderman
Install
npm i -g spiderclient
Usage
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 configuration
spider 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
path
is the path of your spider. Ifpath
is a directory, there should be anindex.js
in it.
Example
spider add test.js # index.js in it spider add ./dir
interval
andmaxtime
can be either integer(ms) or string.
Example
# 5000ms spider add a.js -i 5000 # human readable string spider add a.js -i 1h30mspider add a.js -i 1day30mspider add a.js -i 100s50ms
Time 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 information
Example
# 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:1215
spider info
spider info -h Usage: info [options] <spider> get the info of a spider Options: -h, --help output usage information
Example
# use id spider info 1# use name spider info spidername
spider ls
spider ls -h Usage: ls [options] list all spiders Options: -h, --help output usage information
spider ps
spider ps -h Usage: ps [options] list all running spiders Options: -h, --help output usage information
spider 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 information
Example
# delete a stopped spider spider rm 1# delete a running spider spider rm spidername -f
spider start
spider start -h Usage: start [options] <spider> start a spider Options: -h, --help output usage information
spider stop
spider stop -h Usage: stop [options] <spider> stop a spider Options: -h, --help output usage information
spider 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 information
Example:
spider update 1 -i 12000spider update spidername -m 0spider update 2 -i 0 -m 0
LICENSE
MIT