(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 18 Mar 2006 11:51:51 +0000 (11:51 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 18 Mar 2006 11:51:51 +0000 (11:51 +0000)
crawler/kiss/conf/kiss/programs.xml
crawler/kiss/src/org/wamblee/crawler/kiss/KissCrawler.java
crawler/kiss/src/org/wamblee/crawler/kiss/ProgramConfigurationParser.java

index f6d5675d8d6096dfc0651c0307b850ec0582e4be..0fa865e9e8d41934809ae82138eed1eb2c83eb28 100644 (file)
@@ -7,9 +7,13 @@
   
   <program>
     <action>notify</action>
-    <match field="description">((sci-fi)|(science fiction))</match>
+    <match field="description">(sci-fi)|(science fiction)</match>
   </program>
   
+  <program>
+    <action>notify</action>
+    <match>(zembla)|(uur.*wolf)</match>
+  </program>
   
   <program>
     <match>star.*gate</match>
index 8fbd232dcba2c685a4c981e75416b87d8512a3bf..d302fb6e915b8e5bffcf9228837ef015a6fbd453 100644 (file)
@@ -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<ProgramFilter> 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<ProgramFilter> programFilters = new ProgramConfigurationParser()
-                    .parse(programConfigFile);
+          
             recordInterestingShows(programFilters, guide);
         } finally {
             os.flush();
index b8d5c67863adcd9406c3bae2fc76d6f11f86b829..2c05b827233a82888c34be1452ef07e8ed5ff269 100644 (file)
@@ -78,8 +78,8 @@ class ProgramConfigurationParser {
                     if ( fieldAttribute != null ) { 
                         fieldName = fieldAttribute.getText(); 
                     }
-                    String pattern = ".*" + patternElem.getText()
-                    + ".*";
+                    String pattern = ".*(" + patternElem.getText()
+                    + ").*";
                     regexConditions.add(new PropertyRegexCondition<Program>(fieldName, pattern, true));
                 }
                 Condition<Program> condition = new AndCondition<Program>(regexConditions);