summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Franke <nobody@nowhere.ws>2013-10-11 01:30:24 +0200
committerChristian Franke <nobody@nowhere.ws>2013-10-11 01:33:54 +0200
commitaebffce1aae431183545ea9519102f07032fb07f (patch)
tree9f8be59727783f4303528975412c0c100c45287b
parent2c31074d1f5ad41cc540a991e2c347ccb3bb6f9f (diff)
Add a streaming info script
-rwxr-xr-xscripts/streaming.py23
-rw-r--r--template/template/template.html6
2 files changed, 28 insertions, 1 deletions
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 @@
<link rel="stylesheet" href="/css/trieste.status.css" type="text/css">
<link rel="stylesheet" href="/css/nautilus.status.css" type="text/css">
<link rel="stylesheet" href="/css/sublab.status.css" type="text/css">
+ <link rel="stylesheet" href="/css/stream.status.css" type="text/css">
<link rel="shortcut icon" href="/img/favicon.png">
<link rel="space-api" href="/status.json" />
</head>
@@ -129,7 +130,10 @@ Git</a>
</tr>-->
</table>
</div>
- <hr>
+ <hr>
+ <p class="stream-ad">
+ <a href="http://void.subsignal.org:9000/status.xsl"><b>Livestream</b></a>
+ </p>
<p class="status">
$template_chattopic
</p>