Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
php error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Weasel" data-source="post: 339342" data-attributes="member: 9520"><p>Retrieving such SHOUTcast information is a bit harder than what you are trying to do now. You actually need PHP to retrieve data from their XML file, or you could spider (crawl) the site. Anyways, take a look into this: <a href="http://forums.winamp.com/showthread.php?t=327864" target="_blank">http://forums.winamp.com/showthread.php?t=327864</a></p><p></p><p>EDIT:</p><p>I found an old script I used before, at the top define your stream's own server IP, server port and password. Then you can use the $aim variable to echo the Habboname if they fill in in the "AIM" field when they connect to the SHOUTcast server.</p><p></p><p>[PHP]<?php</p><p>$scip = "SERVERIP";</p><p>$scport = "SERVERPORT";</p><p>$scpass = "SERVERPASSWORD";</p><p></p><p>$scfp = fsockopen($scip, $scport, $errno, $errstr, 10);</p><p>if (!$scfp)</p><p>{</p><p> $scsuccs = 1;</p><p>}</p><p></p><p>if ($scsuccs != 1)</p><p>{</p><p> fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n");</p><p> while(!feof($scfp))</p><p> {</p><p> $page .= fgets($scfp, 1000);</p><p> }</p><p></p><p> $loop = array("STREAMSTATUS", "SERVERTITLE", "CURRENTLISTENERS", "AIM");</p><p> $y = 0;</p><p> </p><p> while($loop[$y] != '')</p><p> {</p><p> $pageed = ereg_replace(".*<$loop[$y]>", "", $page);</p><p> $scphp = strtolower($loop[$y]);</p><p> $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed);</p><p> if ($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE)</p><p> {</p><p> $$scphp = urldecode($$scphp);</p><p> }</p><p> </p><p> $y++;</p><p> }</p><p></p><p> $pageed = ereg_replace(".*<SONGHISTORY>", "", $page);</p><p> $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed);</p><p> $songatime = explode("<SONG>", $pageed);</p><p> $r = 1;</p><p> </p><p> while($songatime[$r]!="")</p><p> {</p><p> $t=$r-1;</p><p> $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]);</p><p> $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]);</p><p> $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]);</p><p> $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]);</p><p> $song[$t] = urldecode($song[$t]);</p><p> $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page);</p><p> $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed);</p><p> $r++;</p><p> }</p><p></p><p> fclose($scfp);</p><p>}[/PHP]</p></blockquote><p></p>
[QUOTE="Weasel, post: 339342, member: 9520"] Retrieving such SHOUTcast information is a bit harder than what you are trying to do now. You actually need PHP to retrieve data from their XML file, or you could spider (crawl) the site. Anyways, take a look into this: [URL]http://forums.winamp.com/showthread.php?t=327864[/URL] EDIT: I found an old script I used before, at the top define your stream's own server IP, server port and password. Then you can use the $aim variable to echo the Habboname if they fill in in the "AIM" field when they connect to the SHOUTcast server. [PHP]<?php $scip = "SERVERIP"; $scport = "SERVERPORT"; $scpass = "SERVERPASSWORD"; $scfp = fsockopen($scip, $scport, $errno, $errstr, 10); if (!$scfp) { $scsuccs = 1; } if ($scsuccs != 1) { fputs($scfp,"GET /admin.cgi?pass=$scpass&mode=viewxml HTTP/1.0\r\nUser-Agent: SHOUTcast Song Status (Mozilla Compatible)\r\n\r\n"); while(!feof($scfp)) { $page .= fgets($scfp, 1000); } $loop = array("STREAMSTATUS", "SERVERTITLE", "CURRENTLISTENERS", "AIM"); $y = 0; while($loop[$y] != '') { $pageed = ereg_replace(".*<$loop[$y]>", "", $page); $scphp = strtolower($loop[$y]); $$scphp = ereg_replace("</$loop[$y]>.*", "", $pageed); if ($loop[$y]==SERVERGENRE || $loop[$y]==SERVERTITLE || $loop[$y]==SONGTITLE || $loop[$y]==SERVERTITLE) { $$scphp = urldecode($$scphp); } $y++; } $pageed = ereg_replace(".*<SONGHISTORY>", "", $page); $pageed = ereg_replace("<SONGHISTORY>.*", "", $pageed); $songatime = explode("<SONG>", $pageed); $r = 1; while($songatime[$r]!="") { $t=$r-1; $playedat[$t] = ereg_replace(".*<PLAYEDAT>", "", $songatime[$r]); $playedat[$t] = ereg_replace("</PLAYEDAT>.*", "", $playedat[$t]); $song[$t] = ereg_replace(".*<TITLE>", "", $songatime[$r]); $song[$t] = ereg_replace("</TITLE>.*", "", $song[$t]); $song[$t] = urldecode($song[$t]); $dj[$t] = ereg_replace(".*<SERVERTITLE>", "", $page); $dj[$t] = ereg_replace("</SERVERTITLE>.*", "", $pageed); $r++; } fclose($scfp); }[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
php error
Top