change url find to match #94

master
yihua.huang 2014-04-25 16:04:41 +08:00
parent f973889cda
commit 4738ae2d14
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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();
}
}