<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RayRay Is Forever &#187; PHP</title>
	<atom:link href="http://blog.rayrayisforever.com/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.rayrayisforever.com</link>
	<description>Boyfriends Are Temporary!</description>
	<lastBuildDate>Mon, 17 May 2010 19:21:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Code to display the current song and number of listeners of a shoutcast server</title>
		<link>http://blog.rayrayisforever.com/2009/03/php-code-to-display-the-current-song-and-number-of-listeners-of-a-shoutcast-server</link>
		<comments>http://blog.rayrayisforever.com/2009/03/php-code-to-display-the-current-song-and-number-of-listeners-of-a-shoutcast-server#comments</comments>
		<pubDate>Tue, 10 Mar 2009 05:58:04 +0000</pubDate>
		<dc:creator>RayRay</dc:creator>
				<category><![CDATA[Server Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[shoutcast]]></category>

		<guid isPermaLink="false">http://www.hardcoredreamer.com/blog/?p=121</guid>
		<description><![CDATA[To help out those of you with shoutcast stations and want to show them off! You can use this code in Drupal or any CMS or page that accepts PHP code.  Just fill in the IP address of your shoutcast server and the port in which it listens on and this script will output [...]]]></description>
			<content:encoded><![CDATA[<p>To help out those of you with shoutcast stations and want to show them off! You can use this code in Drupal or any CMS or page that accepts PHP code.  Just fill in the IP address of your shoutcast server and the port in which it listens on and this script will output the current song and the number of listeners. There are variations of it floating around the internet. Its weakness is that if your song contains any commas (,) then the song title will stop at the comma.</p>
<p><pre><code>&lt;?php
$ip = &quot;127.0.0.1&quot;;
$port = &quot;8000&quot;;
$fp = @fsockopen($ip,$port,$errno,$errstr,1);
if (!$fp)
{
echo &quot;Connection refused&quot;; // Diaplays when sever is offline
}
else
{
fputs($fp, &quot;GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n&quot;);
while (!feof($fp))
{
$info = fgets($fp);
}
$info = str_replace(&#039;&#039;, &quot;&quot;, $info);
$split = explode(&#039;,&#039;, $info);
if (empty($split[6]) )
{
echo &quot;The current song is not available&quot;; // Displays when sever is online but no song title
}
else
{
$title = str_replace(&#039;\&#039;&#039;, &#039;`&#039;, $split[6]);
$title = str_replace(&#039;,&#039;, &#039; &#039;, $title);
echo &quot;$title -&nbsp;&nbsp;Listeners: $split[0]&quot;; // Displays song
}
}
?&gt;
</code></pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rayrayisforever.com/2009/03/php-code-to-display-the-current-song-and-number-of-listeners-of-a-shoutcast-server/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
