From: erik Date: Sat, 18 Mar 2006 11:51:51 +0000 (+0000) Subject: (no commit message) X-Git-Tag: BEFORE_MAVEN_MIGRATION~186 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;h=a3c7e2e0c9d0e51fe93ae955f387ebd83f8ed00c;p=utils --- diff --git a/crawler/kiss/conf/kiss/programs.xml b/crawler/kiss/conf/kiss/programs.xml index f6d5675d..0fa865e9 100644 --- a/crawler/kiss/conf/kiss/programs.xml +++ b/crawler/kiss/conf/kiss/programs.xml @@ -7,9 +7,13 @@ notify - ((sci-fi)|(science fiction)) + (sci-fi)|(science fiction) + + notify + (zembla)|(uur.*wolf) + star.*gate diff --git a/crawler/kiss/src/org/wamblee/crawler/kiss/KissCrawler.java b/crawler/kiss/src/org/wamblee/crawler/kiss/KissCrawler.java index 8fbd232d..d302fb6e 100644 --- a/crawler/kiss/src/org/wamblee/crawler/kiss/KissCrawler.java +++ b/crawler/kiss/src/org/wamblee/crawler/kiss/KissCrawler.java @@ -132,16 +132,17 @@ public class KissCrawler { // client.getHostConfiguration().setProxy("127.0.0.1", 3128); Crawler crawler = createCrawler(aCrawlerConfig, os, client); + InputStream programConfigFile = new FileInputStream(new File( + aProgramConfig)); + List programFilters = new ProgramConfigurationParser() + .parse(programConfigFile); Page page = getStartPage(aStartUrl, crawler); TVGuide guide = createGuide(page); PrintVisitor printer = new PrintVisitor(System.out); guide.accept(printer); - InputStream programConfigFile = new FileInputStream(new File( - aProgramConfig)); - List programFilters = new ProgramConfigurationParser() - .parse(programConfigFile); + recordInterestingShows(programFilters, guide); } finally { os.flush(); diff --git a/crawler/kiss/src/org/wamblee/crawler/kiss/ProgramConfigurationParser.java b/crawler/kiss/src/org/wamblee/crawler/kiss/ProgramConfigurationParser.java index b8d5c678..2c05b827 100644 --- a/crawler/kiss/src/org/wamblee/crawler/kiss/ProgramConfigurationParser.java +++ b/crawler/kiss/src/org/wamblee/crawler/kiss/ProgramConfigurationParser.java @@ -78,8 +78,8 @@ class ProgramConfigurationParser { if ( fieldAttribute != null ) { fieldName = fieldAttribute.getText(); } - String pattern = ".*" + patternElem.getText() - + ".*"; + String pattern = ".*(" + patternElem.getText() + + ").*"; regexConditions.add(new PropertyRegexCondition(fieldName, pattern, true)); } Condition condition = new AndCondition(regexConditions);