Shoutcast Servertitle en Now playing script

Gestart doorMarv3 reacties18 weergaven

4 berichten · pagina 1 van 1

Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Hallo,

Ik zoek een Shoutcast Script wat de Server title en het liedje wat nu speelt weergeeft.

Moet met PHP 5.4 werken

Mvg,
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Ik had deze nog voor je liggen..
Als ik jou was, zou ik m in een iframe droppen! smile
Spoiler tonen
<script>
<!--

/*
SCRIPT BY JOCHEMSTOBBE.NL ***
*/

//enter refresh time in "minutes:seconds" Minutes should range from 0 to inifinity. Seconds should range from 0 to 59
var limit="0:30"

if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh(){
if (!document.images)
return
if (parselimit==1)
window.location.reload()
else{ 
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
if (curmin!=0)
curtime=curmin+" minutes and "+cursec+" seconds left until page refresh!"
else
curtime=cursec+"Station naam"
window.status=curtime
setTimeout("beginrefresh()",1000)
}
}

window.onload=beginrefresh
//-->
</script>

<link href="npstyle.css" rel="stylesheet" type="text/css" />
<center><p class="np">[COLOR= #0000BB]<?[/COLOR]

[COLOR= #FF8000]//pas server.adres aan naar jou shoutcast server
//pas poort aan naar jou poort[/COLOR]
[COLOR= #0000BB]$fp[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/fsockopen"]fsockopen[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"IP"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"POORT"[/COLOR][COLOR= #007700], &[/COLOR][COLOR= #0000BB]$errno[/COLOR][COLOR= #007700], &[/COLOR][COLOR= #0000BB]$errstr[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]30[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #FF8000]//Kijken of er een connectie gemaakt kan worden ( of de server dus ONLINE is )[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$fp[/COLOR][COLOR= #007700]) {[/COLOR]
    [COLOR= #0000BB]$connect[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700];
}[/COLOR]

[COLOR= #FF8000]//als die dat is dan haalt die 7.html binnen van de shoutcast server[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$connect[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/fputs"]fputs[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fp[/COLOR][COLOR= #007700],[/COLOR][COLOR= #DD0000]"GET /7.html HTTP/1.0rnUser-Agent: XML Getter (Mozilla Compatible)rnrn"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/feof"]feof[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fp[/COLOR][COLOR= #007700])) {[/COLOR]
[COLOR= #FF8000]//de var $page krijgt als waarde de inhoud van 7.html van de shoutcast server[/COLOR]
  [COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/fgets"]fgets[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fp[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]1000[/COLOR][COLOR= #007700]);
}[/COLOR]

[COLOR= #FF8000]//Verbinding kan worden verbroken die hebben we niet meer nodig[/COLOR]
[URL="http://www.php.net/fclose"]fclose[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fp[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #FF8000]//De onnodige dingen er uit halen[/COLOR]
[COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ereg_replace"]ereg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]".*<body>"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$page[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$page[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ereg_replace"]ereg_replace[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"</body>.*"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]","[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$page[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #FF8000]//Het geen wat over blijft uit elkaar raveleen[/COLOR]
[COLOR= #0000BB]$numbers[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$page[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #FF8000]//kijken of de Winamp plugin aan het "streamen" is[/COLOR]
[COLOR= #0000BB]$streaming[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #0000BB]$numbers[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]

[COLOR= #FF8000]//Als die dat is geef $song de waarde van de song uit $page ( 7.html )[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$streaming[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]){[/COLOR]
   [COLOR= #0000BB]$song[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$numbers[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]6[/COLOR][COLOR= #007700]];
}[/COLOR]

[COLOR= #FF8000]//Als die niet streamd dan geef $status de waarde nostream[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$streaming[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000]"1"[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$status[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"nostream"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[COLOR= #FF8000]//Als er in het begin geen connectie is gemaakt geef dan een text weer...[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$connect[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Geen verbinding met de stream!<br>
Excuses voor het ongemak."[/COLOR][COLOR= #007700];
}[/COLOR]

[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]//Als er geen uitzending is geef dan ook melding weer[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$status[/COLOR] [COLOR= #007700]==[/COLOR] nostream[COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Radionaam is niet online, probeer het later nog eens!"[/COLOR][COLOR= #007700];
}[/COLOR]

[COLOR= #FF8000]//als alles goed is geef dan de song weer[/COLOR]

[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL]  [COLOR= #DD0000]" $song"[/COLOR][COLOR= #007700];
}
}[/COLOR]
?></p></center>
0
Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beter: php include (wink
0
Marv

Lid · Topicstarter

Berichten
3.092
Reputatie
1
Punten
0,21
Lid sinds
Laatst gezien
Bjarnootjuh schreef:
Beter: php include (wink
Dus niet.... (smile)
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren