summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2010-08-08 10:29:30 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2010-08-08 10:29:30 +0300
commit7e0babe7ffd6cc1d15d7936e20932931fe1df916 (patch)
treedadbad370a1f84bfa1358e8e8201cf812b0c5035
parent62cb5db0c242d4ade3dbbe779c6998a381e886dc (diff)
downloadvdr-plugin-webvideo-7e0babe7ffd6cc1d15d7936e20932931fe1df916.tar.gz
vdr-plugin-webvideo-7e0babe7ffd6cc1d15d7936e20932931fe1df916.tar.bz2
MoonTV support (contributed by Matti Lehtimäki)
-rw-r--r--HISTORY4
-rw-r--r--templates/moontv/description.xsl19
-rw-r--r--templates/moontv/mainmenu.xsl23
-rw-r--r--templates/moontv/navigation.xsl20
-rw-r--r--templates/moontv/programlist.xsl20
-rw-r--r--templates/moontv/rss.xsl28
-rw-r--r--templates/moontv/service.xml7
-rw-r--r--templates/moontv/video.xsl15
8 files changed, 136 insertions, 0 deletions
diff --git a/HISTORY b/HISTORY
index 8708c26..931f1f8 100644
--- a/HISTORY
+++ b/HISTORY
@@ -192,3 +192,7 @@ Video site modules:
- Timers are no longer marked as "Unfinished" after the download has
been completed.
- Retry failed timers again later.
+
+2010-xx-xx: Version 0.3.2
+
+- New video service: MoonTV (contributed by Matti Lehtimäki)
diff --git a/templates/moontv/description.xsl b/templates/moontv/description.xsl
new file mode 100644
index 0000000..6665f7f
--- /dev/null
+++ b/templates/moontv/description.xsl
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="/">
+<wvmenu>
+ <title><xsl:value-of select="normalize-space(concat(substring-before(//div[@id='single-entry']/h3, '&#8211;'), ' - ' , substring-after(//div[@id='single-entry']/h3, '&#8211;')))"/></title>
+ <textarea>
+ <label><xsl:value-of select="//div[@id='single-entry']/p"/></label>
+ </textarea>
+ <textarea>
+ <!-- Julkaistu -->
+ <label>Julkaistu: <xsl:value-of select="//div[@id='single-entry']/div[@class='entry-footer']/p"/></label>
+ </textarea>
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/moontv/mainmenu.xsl b/templates/moontv/mainmenu.xsl
new file mode 100644
index 0000000..fea995b
--- /dev/null
+++ b/templates/moontv/mainmenu.xsl
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings">
+
+<xsl:template match="/">
+<wvmenu>
+ <title>Katsomo</title>
+
+ <link>
+ <label>MoonTV ohjelmat</label>
+ <ref>wvt:///moontv/programlist.xsl?srcurl=http://moontv.fi/ohjelmat</ref>
+ </link>
+ <link>
+ <label>MoonTV uusimmat videot</label>
+ <ref>wvt:///moontv/rss.xsl?srcurl=http://feeds.feedburner.com/Moontv?format=rss</ref>
+ </link>
+
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/moontv/navigation.xsl b/templates/moontv/navigation.xsl
new file mode 100644
index 0000000..4ec54a7
--- /dev/null
+++ b/templates/moontv/navigation.xsl
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings">
+
+<xsl:template match="/">
+<wvmenu>
+ <title><xsl:value-of select="//div[@id='content']/h2"/></title>
+ <xsl:for-each select="//div[@class='entry']">
+ <link>
+ <label><xsl:value-of select="h3"/></label>
+ <ref>wvt:///moontv/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(h3/a/@href, true())"/></ref>
+ <stream>wvt:///moontv/video.xsl?srcurl=<xsl:value-of select="str:encode-uri(h3/a/@href, true())"/></stream>
+ </link>
+ </xsl:for-each>
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/moontv/programlist.xsl b/templates/moontv/programlist.xsl
new file mode 100644
index 0000000..cbea52a
--- /dev/null
+++ b/templates/moontv/programlist.xsl
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings">
+
+<xsl:template match="/">
+<wvmenu>
+ <title>MoonTV ohjelmat</title>
+
+ <xsl:for-each select="//ul[@id='ohjelmat-list']/li/h5/a">
+ <link>
+ <label><xsl:value-of select="."/></label>
+ <ref>wvt:///moontv/navigation.xsl?srcurl=<xsl:value-of select="str:encode-uri(concat('http://moontv.fi',@href), true())"/></ref>
+ </link>
+ </xsl:for-each>
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/moontv/rss.xsl b/templates/moontv/rss.xsl
new file mode 100644
index 0000000..bb42d7a
--- /dev/null
+++ b/templates/moontv/rss.xsl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings">
+
+<xsl:param name="docurl"/>
+
+<xsl:template match="/rss/channel/item">
+ <link>
+ <label><xsl:value-of select="concat(category, ': ',title)"/></label>
+ <ref>wvt:///moontv/description.xsl?srcurl=<xsl:value-of select="str:encode-uri(link, true())"/></ref>
+ <!-- MoonTV rss-linkit -->
+ <stream>wvt:///moontv/video.xsl?srcurl=<xsl:value-of select="link"/></stream>
+ </link>
+</xsl:template>
+
+<xsl:template match="/">
+<wvmenu>
+ <!-- Videolinkit -->
+ <xsl:if test="/rss">
+ <title><xsl:value-of select="/rss/channel/title"/></title>
+ <xsl:apply-templates select="/rss/channel/item"/>
+ </xsl:if>
+</wvmenu>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/templates/moontv/service.xml b/templates/moontv/service.xml
new file mode 100644
index 0000000..aa1a5bd
--- /dev/null
+++ b/templates/moontv/service.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<service>
+ <title>MoonTV</title>
+ <ref>wvt:///moontv/mainmenu.xsl?srcurl=http%3A//moontv.fi/ohjelmat</ref>
+ <description>Video service by MoonTV, a Finnish online video channel</description>
+</service>
diff --git a/templates/moontv/video.xsl b/templates/moontv/video.xsl
new file mode 100644
index 0000000..9fa6108
--- /dev/null
+++ b/templates/moontv/video.xsl
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings">
+
+<xsl:template match="/">
+ <mediaurl>
+ <!-- Jakson/ohjelman nimi -->
+ <title><xsl:value-of select="normalize-space(concat(substring-before(//div[@id='single-entry']/h3, '&#8211;'), ' - ' , substring-after(//div[@id='single-entry']/h3, '&#8211;')))"/></title>
+ <url priority="50"><xsl:value-of select='substring-before(substring-after(//div[@id="single-entry"]/script, "file&apos;,&apos;"), "&apos;")'/></url>
+ </mediaurl>
+</xsl:template>
+
+</xsl:stylesheet>