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 {
@Override
public RequestMatcher.MatchOther processResult(ResultItems resultItems, Task task) {
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;
}
};
......@@ -49,12 +49,12 @@ public class PatternProcessorExample {
@Override
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;
}
};
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();
pageProcessor.setSubPageProcessors(githubRepoProcessor, githubUserProcessor);
......
......@@ -32,6 +32,6 @@ public abstract class PatternRequestMatcher implements RequestMatcher {
@Override
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