2.2.3 • Published 7 years ago

spiderclient v2.2.3

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

spiderclient_logo

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 for once
    -m, --maxtime <maxtime>    max time for spider to run at once
    -h, --help                 output usage information
  • path is the path of your spider. If path is a directory, there should be an index.js in it.

Example

spider add test.js

# index.js in it
spider add ./dir
  • interval and maxtime can 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 100s50ms

Time Keywords:

  • ms, milli, millisecond, milliseconds - will parse to milliseconds
  • s, sec, secs, second, seconds - will parse to seconds
  • m, min, mins, minute, minutes - will parse to minutes
  • h, hr, hrs, hour, hours - will parse to hours
  • d, 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 12000
spider update spidername -m 0
spider update 2 -i 0 -m 0

LICENSE

MIT

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.0.0

7 years ago