From aebffce1aae431183545ea9519102f07032fb07f Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Fri, 11 Oct 2013 01:30:24 +0200 Subject: Add a streaming info script --- scripts/streaming.py | 23 +++++++++++++++++++++++ template/template/template.html | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 scripts/streaming.py diff --git a/scripts/streaming.py b/scripts/streaming.py new file mode 100755 index 0000000..95367f5 --- /dev/null +++ b/scripts/streaming.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python2 + +import urllib2 +from lxml import etree + +doc = urllib2.urlopen('http://void.subsignal.org:9000/sublounge.xsl').read() +tree = etree.fromstring(doc) + +sources = tree.findall('source') +sublab_sources = [] +for source in sources: + if 'mount' not in source.attrib: + continue + mount = source.attrib['mount'] + if mount.startswith('/subsig'): + continue + if mount.startswith('/sub'): + sublab_sources.append(source) + +if not sublab_sources: + print ".stream-ad { display: none; }" +else: + print "/* .stream-ad { display: none; } */" diff --git a/template/template/template.html b/template/template/template.html index 16bad39..dd655dc 100644 --- a/template/template/template.html +++ b/template/template/template.html @@ -21,6 +21,7 @@ + @@ -129,7 +130,10 @@ Git --> -
+
+

+ Livestream +

$template_chattopic

-- cgit v1.2.1