···
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2
-
<xsl:output method="html"
3
-
doctype-system="about:legacy-compat"
5
-
<xsl:template match="/icestats">
6
-
<html xmlns="http://www.w3.org/1999/xhtml">
8
-
<meta charset="utf-8" />
9
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
10
-
<title>radio.rita.moe</title>
11
-
<link rel="icon" href="https://rita.moe/rita-icon.png" />
12
-
<link rel="stylesheet" type="text/css" href="style-status.css" />
13
-
<link rel="stylesheet" href="https://cdn.plyr.io/3.5.8/plyr.css" />
14
-
<script src="https://cdn.plyr.io/3.5.8/plyr.polyfilled.js"></script>
17
-
<div class="content">
18
-
<h1 id="header">radio.rita.moe</h1>
19
-
<!--mount point stats-->
20
-
<xsl:for-each select="source">
22
-
<xsl:when test="listeners">
23
-
<div class="roundbox">
24
-
<div class="mounthead">
26
-
<xsl:value-of select="server_name" />
27
-
<small>(<xsl:value-of select="@mount" />)</small>
31
-
<xsl:when test="authenticator">
32
-
<a class="auth" href="/auth.xsl">Login</a>
35
-
<ul class="mountlist">
37
-
<a class="play" href="{@mount}.m3u">M3U</a>
41
-
<a class="play" href="{@mount}.xspf">XSPF</a>
44
-
<a class="play" href="{@mount}.vclt">VCLT</a>
52
-
<div class="mountcont">
53
-
<xsl:if test="server_type">
54
-
<div class="audioplayer">
55
-
<audio controls="controls" preload="none">
56
-
<source src="{@mount}" type="{server_type}" />
60
-
<div class="playing">
61
-
<xsl:if test="artist">
62
-
<xsl:value-of select="artist" />
65
-
<xsl:value-of select="title" />
2
+
<xsl:output method="html"
3
+
doctype-system="about:legacy-compat"
5
+
<xsl:template match="/icestats">
6
+
<html xmlns="http://www.w3.org/1999/xhtml">
8
+
<meta charset="utf-8" />
9
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
10
+
<title>Radio Rita.moe</title>
11
+
<link rel="icon" href="https://rita.moe/rita-icon.png" />
12
+
<link rel="stylesheet" type="text/css" href="style-status.css" />
13
+
<link rel="stylesheet" href="https://cdn.plyr.io/3.5.8/plyr.css" />
14
+
<script src="https://cdn.plyr.io/3.5.8/plyr.polyfilled.js"></script>
17
+
<div class="content">
18
+
<h1 id="header">Radio Rita.moe</h1>
19
+
<!--mount point stats-->
20
+
<xsl:for-each select="source">
22
+
<xsl:when test="listeners">
23
+
<div class="roundbox" data-mount="{@mount}">
24
+
<div class="mounthead">
26
+
<xsl:value-of select="server_name" />
27
+
<small>(<xsl:value-of select="@mount" />)</small>
31
+
<xsl:when test="authenticator">
32
+
<a class="auth" href="/auth.xsl">Login</a>
72
-
<xsl:value-of select="@mount" />
35
+
<ul class="mountlist">
37
+
<a class="play" href="{@mount}.m3u">M3U</a>
41
+
<a class="play" href="{@mount}.xspf">XSPF</a>
44
+
<a class="play" href="{@mount}.vclt">VCLT</a>
79
-
Powered by <a href="https://www.icecast.org">Icecast</a>
80
-
and <a href="https://www.liquidsoap.info">Liquidsoap</a>.
52
+
<div class="mountcont">
53
+
<xsl:if test="server_type">
54
+
<div class="audioplayer">
55
+
<audio controls="controls" preload="none">
56
+
<source src="{@mount}" type="{server_type}" />
60
+
<div class="playing">
61
+
<xsl:if test="artist">
62
+
<xsl:value-of select="artist" />
65
+
<xsl:value-of select="title" />
67
+
<div class="search">
68
+
<a href="/" onclick="ss('{@mount}'); return false;">(search)</a>
83
-
<script type="text/javascript">
75
+
<xsl:value-of select="@mount" />
82
+
Powered by <a href="https://www.icecast.org">Icecast</a>
83
+
and <a href="https://www.liquidsoap.info">Liquidsoap</a>.
86
+
<script type="text/javascript">
86
-
fetch('https://radio.rita.moe/status-json.xsl')
87
-
.then(r => r.json())
90
-
document.querySelector('.playing').innerHTML = j.icestats.source.title
88
+
function ss (mount) {
89
+
let title = document.querySelector('[data-mount="' + mount + '"] .playing').innerHTML
90
+
let se = document.querySelector('[data-mount="' + mount + '"] .search a')
91
+
se.innerHTML = 'Please wait...'
92
+
fetch('https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=1&safeSearch=none&type=video&videoCategoryId=10&key=AIzaSyB0PbGfWP_AwEXx7_DypkJiB0qIjHxedi0&q=' + encodeURIComponent(title))
93
+
.then(r => r.json())
95
+
se.innerHTML = '(search)'
96
+
if (j.items.length > 0) {
97
+
window.open('https://combine.fm/youtube/track/' + j.items[0].id.videoId, '_blank')
103
+
fetch('https://radio.rita.moe/status-json.xsl')
104
+
.then(r => r.json())
107
+
document.querySelector('[data-mount="/music"] .playing').innerHTML = j.icestats.source.title
95
-
setInterval(s, 3000)
112
+
setInterval(s, 3000)
97
-
document.querySelectorAll('audio').forEach(e => {
99
-
controls: ['play', 'current-time', 'mute', 'volume'],
101
-
toggleInvert: false
114
+
document.querySelectorAll('audio').forEach(e => {
116
+
controls: ['play', 'current-time', 'mute', 'volume'],
118
+
toggleInvert: false