From facc3507513e29443618f8ac802886254f3e7253 Mon Sep 17 00:00:00 2001 From: zlaxy Date: Mon, 26 Jun 2017 14:06:58 +0300 Subject: [PATCH] Remove outdated station and add 3 new --- anthrstlsht.css | 6 ++--- id.php | 63 +++++++++++++++++++++++++++++++++++++++++++------ index.html | 49 +++++++++++++++++++++++++++----------- 3 files changed, 94 insertions(+), 24 deletions(-) diff --git a/anthrstlsht.css b/anthrstlsht.css index 4d23c6f..fa90825 100644 --- a/anthrstlsht.css +++ b/anthrstlsht.css @@ -48,9 +48,9 @@ h5 { h6 { font-size: 1.2rem; - -moz-text-shadow: 0 0 10px #00afee; - -webkit-text-shadow: 0 0 10px #00afee; - text-shadow: 0 0 10px #00afee; + -moz-text-shadow: 0 0 10px #fff; + -webkit-text-shadow: 0 0 10px #fff; + text-shadow: 0 0 10px #fff; } hr { diff --git a/id.php b/id.php index bb744d9..e0a986c 100644 --- a/id.php +++ b/id.php @@ -2,15 +2,16 @@ echo "id:;:"; -function getID($radioip,$radioport) +// Shoutcast +function getID($radioip,$radioport,$postfix = "GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n") { $open = fsockopen($radioip,$radioport,$errno,$errstr,'.5'); if ($open) { - fputs($open,"GET /7.html HTTP/1.1\nUser-Agent:Mozilla\n\n"); + fputs($open,$postfix); stream_set_timeout($open,'1'); $read = fread($open,255); $exploded = explode(",",$read); - if(exploded[6] == '' || $exploded[6] == '') + if($exploded[6] == '' || $exploded[6] == '') { $text = 'streaming'; } else { $text = $exploded[6]; } $id = str_replace("","",$text); } else { return false; } @@ -18,6 +19,45 @@ function getID($radioip,$radioport) return $id; } +// Icecast +// https://stackoverflow.com/a/17109654 +function getMp3StreamTitle($streamingUrl, $interval, $offset = 0, $headers = true) + { + $needle = 'StreamTitle='; + $ua = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36'; + + $opts = [ + 'http' => [ + 'method' => 'GET', + 'header' => 'Icy-MetaData: 1', + 'user_agent' => $ua + ] + ]; + + if (($headers = get_headers($streamingUrl))) + foreach ($headers as $h) + if (strpos(strtolower($h), 'icy-metaint') !== false && ($interval = explode(':', $h)[1])) + break; + + $context = stream_context_create($opts); + + if ($stream = fopen($streamingUrl, 'r', false, $context)) + { + $buffer = stream_get_contents($stream, $interval, $offset); + fclose($stream); + + if (strpos($buffer, $needle) !== false) + { + $title = explode($needle, $buffer)[1]; + return substr($title, 1, strpos($title, ';') - 2); + } + else + return getMp3StreamTitle($streamingUrl, $interval, $offset + $interval, false); + } + else + throw new Exception("Unable to open stream [{$streamingUrl}]"); + } + $radioip = "93.100.61.75"; $radioport = "8000"; echo getID($radioip,$radioport).":;:"; @@ -27,11 +67,20 @@ function getID($radioip,$radioport) $radioip = "173.236.30.162"; $radioport = "8022"; echo getID($radioip,$radioport).":;:"; - $radioip = "91.237.213.34"; - $radioport = "8008"; - echo getID($radioip,$radioport).":;:"; +// // outdated: +// $radioip = "91.237.213.34"; +// $radioport = "8008"; +// echo getID($radioip,$radioport).":;:"; $radioip = "79.120.39.202"; $radioport = "9009"; - echo getID($radioip,$radioport); + echo getID($radioip,$radioport).":;:"; + + echo getMp3StreamTitle('http://audio-online.net:8015/live', 19200).":;:"; + echo getMp3StreamTitle('http://prem2.di.fm/dubtechno_hi?95f925a23d7093d9f7156fc5', 19200).":;:"; + + $radioip = "136.243.16.19"; + $radioport = "8000"; + $postfix = "GET /7.html?sid=3 HTTP/1.1\nUser-Agent:Mozilla\n\n"; + echo getID($radioip,$radioport,$postfix).":;:"; ?> \ No newline at end of file diff --git a/index.html b/index.html index c4da05e..4acacf1 100644 --- a/index.html +++ b/index.html @@ -34,8 +34,11 @@ a8" `Y88 88 88 88P' "8a 88 a8P_____88 a8" "" 88P' "8a document.getElementById("first").innerHTML = kvID[1]; document.getElementById("second").innerHTML = kvID[2]; document.getElementById("third").innerHTML = kvID[3]; - document.getElementById("fourth").innerHTML = kvID[4]; - document.getElementById("fifth").innerHTML = kvID[5]; +// document.getElementById("fourth").innerHTML = kvID[4]; + document.getElementById("fifth").innerHTML = kvID[4]; + document.getElementById("sixth").innerHTML = kvID[5]; + document.getElementById("seventh").innerHTML = kvID[6]; + document.getElementById("eighth").innerHTML = kvID[7]; }) } } @@ -48,30 +51,48 @@ a8" `Y88 88 88 88P' "8a 88 a8P_____88 a8" "" 88P' "8a
-
Anima Amoris [Dub Techno]
- http://93.100.61.75:8000
+
Anima Amoris [Dub Techno]
+
http://93.100.61.75:8000
-
arctic dub (sursumcorda)
- http://67.212.165.106:8144
+
arctic dub (sursumcorda)
+
http://67.212.165.106:8144
-
Dub Techno Station
- http://173.236.30.162:8022
+
Dub Techno Station
+
http://173.236.30.162:8022
-
+ +
+
Radio Caprice - Dub Techno
+
http://79.120.39.202:9009
+
+
Loca FM Dub Techno
+
http://audio-online.net:8015/live
+
+
+
+
Digitally Imported Dub Techno
+
http://prem2.di.fm/dubtechno_hi
+
+
+
+
Chillkyway - outer space
+
http://sonus.fm:8000
+
+
+
+
+

- \ No newline at end of file +