Commit 4738ae2d authored by yihua.huang's avatar yihua.huang

change url find to match #94

parent f973889c
...@@ -31,7 +31,7 @@ public class PatternProcessorExample { ...@@ -31,7 +31,7 @@ public class PatternProcessorExample {
@Override @Override
public RequestMatcher.MatchOther processResult(ResultItems resultItems, Task task) { public RequestMatcher.MatchOther processResult(ResultItems resultItems, Task task) {
log.info("Extracting from repo" + resultItems.getRequest()); log.info("Extracting from repo" + resultItems.getRequest());
System.out.println(resultItems.get("reponame")); System.out.println("Repo name: "+resultItems.get("reponame"));
return RequestMatcher.MatchOther.YES; return RequestMatcher.MatchOther.YES;
} }
}; };
...@@ -49,12 +49,12 @@ public class PatternProcessorExample { ...@@ -49,12 +49,12 @@ public class PatternProcessorExample {
@Override @Override
public RequestMatcher.MatchOther processResult(ResultItems resultItems, Task task) { public RequestMatcher.MatchOther processResult(ResultItems resultItems, Task task) {
System.out.println(resultItems.get("username")); System.out.println("User name: "+resultItems.get("username"));
return RequestMatcher.MatchOther.YES; return RequestMatcher.MatchOther.YES;
} }
}; };
CompositePageProcessor pageProcessor = new CompositePageProcessor(Site.me().setDomain("github.com")); CompositePageProcessor pageProcessor = new CompositePageProcessor(Site.me().setDomain("github.com").setRetryTimes(0).setSleepTime(0));
CompositePipeline pipeline = new CompositePipeline(); CompositePipeline pipeline = new CompositePipeline();
pageProcessor.setSubPageProcessors(githubRepoProcessor, githubUserProcessor); pageProcessor.setSubPageProcessors(githubRepoProcessor, githubUserProcessor);
......
...@@ -32,6 +32,6 @@ public abstract class PatternRequestMatcher implements RequestMatcher { ...@@ -32,6 +32,6 @@ public abstract class PatternRequestMatcher implements RequestMatcher {
@Override @Override
public boolean match(Request request) { public boolean match(Request request) {
return patternCompiled.matcher(request.getUrl()).find(); return patternCompiled.matcher(request.getUrl()).matches();
} }
} }
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