change url find to match #94
parent
f973889cda
commit
4738ae2d14
|
@ -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 {
|
||||||
|
|
||||||
@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 {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean match(Request request) {
|
public boolean match(Request request) {
|
||||||
return patternCompiled.matcher(request.getUrl()).find();
|
return patternCompiled.matcher(request.getUrl()).matches();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue