Commit 296a6892 authored by yihua.huang's avatar yihua.huang

fix javadoc and add setPipelines() for spider

parent 948fa094
...@@ -189,7 +189,7 @@ public class Spider implements Runnable, Task { ...@@ -189,7 +189,7 @@ public class Spider implements Runnable, Task {
* *
* @param pipeline * @param pipeline
* @return this * @return this
* @see #setPipeline(us.codecraft.webmagic.pipeline.Pipeline) * @see #addPipeline(us.codecraft.webmagic.pipeline.Pipeline)
* @deprecated * @deprecated
*/ */
public Spider pipeline(Pipeline pipeline) { public Spider pipeline(Pipeline pipeline) {
...@@ -210,6 +210,20 @@ public class Spider implements Runnable, Task { ...@@ -210,6 +210,20 @@ public class Spider implements Runnable, Task {
return this; return this;
} }
/**
* set pipelines for Spider
*
* @param pipeline
* @return this
* @see Pipeline
* @since 0.4.1
*/
public Spider setPipelines(List<Pipeline> pipelines) {
checkIfRunning();
this.pipelines = pipelines;
return this;
}
/** /**
* clear the pipelines set * clear the pipelines set
* *
......
...@@ -118,6 +118,7 @@ public class ScriptConsole { ...@@ -118,6 +118,7 @@ public class ScriptConsole {
options.addOption(new Option("l", "language", true, "language")); options.addOption(new Option("l", "language", true, "language"));
options.addOption(new Option("t", "thread", true, "thread")); options.addOption(new Option("t", "thread", true, "thread"));
options.addOption(new Option("f", "file", true, "script file")); options.addOption(new Option("f", "file", true, "script file"));
options.addOption(new Option("i", "input", true, "input file"));
options.addOption(new Option("s", "sleep", true, "sleep time")); options.addOption(new Option("s", "sleep", true, "sleep time"));
options.addOption(new Option("g", "logger", true, "sleep time")); options.addOption(new Option("g", "logger", true, "sleep time"));
CommandLineParser commandLineParser = new PosixParser(); CommandLineParser commandLineParser = new PosixParser();
......
...@@ -6,4 +6,6 @@ var config = { ...@@ -6,4 +6,6 @@ var config = {
ua: '', ua: '',
sleepTime : 20 sleepTime : 20
} }
title = $("div.BlogTitle h1"),
content = $("div.BlogContent")
urls("http://my\\.oschina\\.net/flashsword/blog/\\d+") urls("http://my\\.oschina\\.net/flashsword/blog/\\d+")
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>webmagic-parent</artifactId> <artifactId>webmagic-parent</artifactId>
<groupId>us.codecraft</groupId> <groupId>us.codecraft</groupId>
<version>0.4.0-SNAPSHOT</version> <version>0.4.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment