(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Mon, 21 Aug 2006 21:53:02 +0000 (21:53 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Mon, 21 Aug 2006 21:53:02 +0000 (21:53 +0000)
crawler/kiss/src/channel-right-now-mobile.xsl [new file with mode: 0644]
crawler/kiss/src/org/wamblee/crawler/kiss/main/KissCrawler.java

diff --git a/crawler/kiss/src/channel-right-now-mobile.xsl b/crawler/kiss/src/channel-right-now-mobile.xsl
new file mode 100644 (file)
index 0000000..15b0c14
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  version="1.0">
+  
+  <xsl:output method="xml"/>
+  <xsl:strip-space elements="xhtml:a"/>
+  
+  <xsl:include href="utilities.xsl"/>
+  
+  <!-- =====================================================
+    Copying template.
+    ===================================================== -->
+  <xsl:template match="@*|node()" mode="copy">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()" mode="copy"/>
+    </xsl:copy>
+  </xsl:template>
+  
+  <xsl:template match="/">
+    <xsl:element name="channel-right-now">
+      <!-- [contains(@class,'listCell')] -->
+      <xsl:apply-templates select="//xhtml:tr[xhtml:td[contains(@class, 'listCell')]]"/>
+    </xsl:element>
+  </xsl:template>
+  
+  <xsl:template match="xhtml:tr">
+     <xsl:element name="action">
+       <xsl:attribute name="name">
+         <xsl:call-template name="string-replace">
+           <xsl:with-param name="src" select="xhtml:td[2]/xhtml:a"/>
+           <xsl:with-param name="from" select="$newline"/>
+           <xsl:with-param name="to" select="''"/>
+         </xsl:call-template>
+       </xsl:attribute>
+       <xsl:attribute name="type">
+         <xsl:text>program-info</xsl:text>
+       </xsl:attribute>
+       <xsl:attribute name="reference">
+         <xsl:value-of select="xhtml:td[2]/xhtml:a/@href"/>
+       </xsl:attribute>
+       <xsl:element name="time">
+         <xsl:call-template name="string-replace">
+           <xsl:with-param name="src" select="xhtml:td[1]"/>
+           <xsl:with-param name="from" select="$newline"/>
+           <xsl:with-param name="to" select="''"/>
+         </xsl:call-template>
+       </xsl:element>
+     </xsl:element>
+    <xsl:text>
+      
+    </xsl:text>
+  </xsl:template>
+  
+  
+</xsl:stylesheet>
index 5d0938990b508b431e194f79b67169bfe0b30f1f..3191ff24e627cffdd5d0eab3321e106c090a3ba9 100644 (file)
@@ -73,7 +73,7 @@ public class KissCrawler {
      * Regular expression for matching time interval strings in the retrieved
      * pages.
      */
-    private static final String TIME_REGEX = "([0-9]{2}):([0-9]{2})[^0-9]*([0-9]{2}):([0-9]{2}).*";
+    private static final String TIME_REGEX = "[^0-9]*([0-9]{2}):([0-9]{2})[^0-9]*([0-9]{2}):([0-9]{2}).*";
 
     /**
      * Compiled pattern for the time regular expression.