<?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"
	>

<channel>
	<title>th1nk</title>
	<atom:link href="http://www.th1nk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.th1nk.com</link>
	<description>Web Concepts and Analysis</description>
	<pubDate>Tue, 19 Aug 2008 21:02:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>blueprint css has a new home</title>
		<link>http://www.th1nk.com/news/blueprint-css-has-a-new-home/</link>
		<comments>http://www.th1nk.com/news/blueprint-css-has-a-new-home/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 21:02:47 +0000</pubDate>
		<dc:creator>Peter Oliver</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.th1nk.com/?p=67</guid>
		<description><![CDATA[The Blueprint CSS framework made a pretty big splash late last year in the web development community. Strangely, after a few months the creator, Olav Bjørkøy, disappeared. The project was hosted on Google Code with a corresponding Google Group, and unfortunately had no other administrators. As the discussion board filled with spam, people began to question [...]]]></description>
			<content:encoded><![CDATA[<p>The Blueprint CSS framework made a pretty big <a href="http://www.google.com/search?q=blueprint+css">splash</a> late last year in the web development community. Strangely, after a few months the creator, <a href="http://bjorkoy.com/">Olav Bjørkøy</a>, disappeared. The project was hosted on Google Code with a corresponding Google Group, and unfortunately had no other administrators. As the discussion board filled with spam, people began to question if the framework would ever make a comeback. Many expressed their displeasure with the situation and left, presumably, for good.</p>
<p>Flash forward to these past couple weeks and a group of developers are resurrecting Blueprint. The project is now located at <a title="Blueprint CSS" href="http://www.blueprintcss.org">blueprintcss.org</a> which links to a <a href="http://github.com/joshuaclayton/blueprint-css/tree/master">new repository hosted at GitHub</a> and a new <a title="Google Group" href="http://groups.google.com/group/blueprint-css">Google Group</a>. Check it out.</p>
<p>Also, if anyone knows of a good post comparing CSS frameworks, I&#8217;d love to see it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.th1nk.com/news/blueprint-css-has-a-new-home/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A potentially dangerous new Firefox extension concept</title>
		<link>http://www.th1nk.com/thoughts/a-potentially-dangerous-new-firefox-extension-concept/</link>
		<comments>http://www.th1nk.com/thoughts/a-potentially-dangerous-new-firefox-extension-concept/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 01:36:01 +0000</pubDate>
		<dc:creator>Peter Oliver</dc:creator>
		
		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://www.th1nk.com/?p=30</guid>
		<description><![CDATA[Now I&#8217;m not trying to be the boy who called wolf here&#8230; but I do believe there is a potentially bad development on the brink of occurring in the Firefox extension world.
That development is the inclusion of the extensions author&#8217;s own referral links to any website that utilizes url based referral codes.
So far, I have [...]]]></description>
			<content:encoded><![CDATA[<p>Now I&#8217;m not trying to be the boy who called wolf here&#8230; but I do believe there is a potentially bad development on the brink of occurring in the Firefox extension world.</p>
<p>That development is the inclusion of the extensions author&#8217;s own referral links to any website that utilizes url based referral codes.</p>
<p>So far, I have only found one example, and it is used in a purely benevolent way. I am referring to the <a href="http://iheartmiro.org/">I ♥ Miro extension</a>. According to the site &#8220;The extension works by simply adding our referral code to the URL when you browse on Amazon. If you follow an Amazon referral link from someone else&#8217;s site, this extension will not override their referral code.&#8221;</p>
<p>But what happens when an eager developer decides to include their Google Adsense id in every instance of a Google ad anywhere on the web? There is no way for a website owner to ever even know they got bypassed. In addition, how many people are going to investigate the code of every extension they download. Next to none. The only potential safeguard available is for those extensions that wish to be listed on <a href="https://addons.mozilla.org/en-US/firefox/">Mozilla&#8217;s Firefox Add-on site</a> be screened for certain types of code to make sure they don&#8217;t try to pull such a move.</p>
<p>I&#8217;m not sure what the solution is to this issue, but I&#8217;d sure like Mozilla or the community to start coming up with it before it becomes a rampant problem. Thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.th1nk.com/thoughts/a-potentially-dangerous-new-firefox-extension-concept/feed/</wfw:commentRss>
		</item>
		<item>
		<title>facilitating social cataloging</title>
		<link>http://www.th1nk.com/ideas/facilitating-social-cataloging/</link>
		<comments>http://www.th1nk.com/ideas/facilitating-social-cataloging/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 06:47:52 +0000</pubDate>
		<dc:creator>Peter Oliver</dc:creator>
		
		<category><![CDATA[Ideas]]></category>

		<guid isPermaLink="false">http://www.th1nk.com/?p=52</guid>
		<description><![CDATA[Perhaps the title I have used is a little ambiguous, but what I mean by social cataloging is social bookmarking functionality for any type of content. We have seen that social bookmarking works (though is it profitable for the people than run the site excluding a buyout?). Now we are starting to see social bookmarking [...]]]></description>
			<content:encoded><![CDATA[<p>Perhaps the title I have used is a little ambiguous, but what I mean by social cataloging is social bookmarking functionality for any type of content. We have seen that social bookmarking works (though is it profitable for the people than run the site excluding a buyout?). Now we are starting to see social bookmarking of specific types of content. There are a number of social bookshelf type sites (<a href="http://www.librarything.com">librarything</a> and <a href="http://www.shelfari.com">shelfari</a> for example), as well as a few image social bookmarking sites (see my earlier post about them <a href="http://www.th1nk.com/assessments/image-bookmarking-the-current-situation/">here</a>). </p>
<p>What I imagine as the end version of all these sites is a web service that allows for the bookmarking or referencing of any type of content. The selling point and the aspect that makes this idea possible is that it would feature an API that lets 3rd party developers create gathering tools like traditional browser extensions and data importing schemes, as well as take the data aggregated and use it however they would like.</p>
<p>All of this would be based on a very simple standard for storing the data within the service. The point is not to try to handle doing everything and simply focus on streamlining the gathering and organization/output process so that any type of description data can be gathered, described, and displayed.</p>
<p>A basic gathering tool as well as a few output templates would of course be necessary to get things started, but I can easily see the web community jumping on such a service and creating absolutely amazing things with it.</p>
<p>If anyone knows of a project working on this or any companies doing something like this we would love to know about it. Comment here or <a href="http://www.th1nk.com/contact/">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.th1nk.com/ideas/facilitating-social-cataloging/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The best advertising money can&#8217;t buy&#8230;</title>
		<link>http://www.th1nk.com/assessments/the-best-advertising-money-cant-buy/</link>
		<comments>http://www.th1nk.com/assessments/the-best-advertising-money-cant-buy/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 06:28:00 +0000</pubDate>
		<dc:creator>Peter Oliver</dc:creator>
		
		<category><![CDATA[Assessments]]></category>

		<guid isPermaLink="false">http://www.th1nk.com/?p=39</guid>
		<description><![CDATA[A Google search for SliceHost gives as the 4th result a review by HostingFu. Read the post and then check out the comments, where you can find a reply by SliceHost themselves and questions by potential customers answered by Scotty of HostingFu himself.
If that doesn&#8217;t convince a potential customer, nothing will.
]]></description>
			<content:encoded><![CDATA[<p>A Google search for SliceHost gives as the 4th result a <a title="HostingFu SliceHost review" href="http://hostingfu.com/article/slicehost-initial-impression" target="_self">review by HostingFu</a>. Read the post and then check out the comments, where you can find a reply by SliceHost themselves and questions by potential customers answered by Scotty of HostingFu himself.</p>
<p>If that doesn&#8217;t convince a potential customer, nothing will.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.th1nk.com/assessments/the-best-advertising-money-cant-buy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Image bookmarking: the current situation</title>
		<link>http://www.th1nk.com/assessments/image-bookmarking-the-current-situation/</link>
		<comments>http://www.th1nk.com/assessments/image-bookmarking-the-current-situation/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 19:31:32 +0000</pubDate>
		<dc:creator>Peter Oliver</dc:creator>
		
		<category><![CDATA[Assessments]]></category>

		<guid isPermaLink="false">http://www.th1nk.com/?p=16</guid>
		<description><![CDATA[When it comes to marking and remembering images from around the web, you have very few options. Traditional image management and sharing sites focus mostly on photos that you have taken and wish to share with the world, but with today&#8217;s massive amount of user generated content, there is a need for services that let [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to marking and remembering images from around the web, you have very few options. Traditional image management and sharing sites focus mostly on photos that you have taken and wish to share with the world, but with today&#8217;s massive amount of user generated content, there is a need for services that let you manage not only what you yourself have made, but what you like that other people have made.</p>
<p><a href="http://www.ffffound.com">FFFFound</a> and <a href="http://vi.sualize.us">Vi.sualize.us</a> are the two standout image bookmarking sites, and surprisingly, they work in completely different ways. Not technologically, but rather in how they facilitate sharing and discovering of new images.</p>
<p><strong>Vi.sualize.us</strong> is, as you might expect, a <a title="Del.icio.us" href="http://www.del.icio.us">Del.icio.us</a> like social image bookmarking site. Users can save images using a bookmarklet or contextual menu (via a Firefox extension) to save, describe, and tag images they come across on the internet. Vi.sualize.us saves the images are saved to your profile/gallery and there are a number of sorting options for your viewing pleasure. In addition, you can browse other people&#8217;s saved images or view the most popular overall. It is in fact a Del.icio.us for images.</p>
<p><strong>FFFFound</strong> is more of an artistic web project. While it also uses a bookmarklet or extension and allows you to save the images you find, that is where the similarities end. FFFFound is more like StumbleUpon than Del.icio.us in that it takes what you have bookmarked and serves you reccommendations based on those. In addition, it is invitation only at this point. It seems to have been built more as a tool to inspire photographers and artists than as an image bookmarking service.</p>
<p>So if you are looking for del.icio.us like functionality for your images, check out vi.sualize.us and if you are of the artistic persuasion, you might start looking for an invitation to FFFFound. I hope to see more projects popping up into this space in the near future, not just for photos, but for all types of content.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.th1nk.com/assessments/image-bookmarking-the-current-situation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to pull statistics from Icecast with PHP</title>
		<link>http://www.th1nk.com/code/how-to-pull-statistics-from-icecast-with-php/</link>
		<comments>http://www.th1nk.com/code/how-to-pull-statistics-from-icecast-with-php/#comments</comments>
		<pubDate>Wed, 28 May 2008 03:09:37 +0000</pubDate>
		<dc:creator>John Galvin</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.th1nk.com/?p=35</guid>
		<description><![CDATA[Update:  I&#8217;ve refactored a good deal of the code here to support radio servers with multiple mount points.  It now uses the SimpleXML functions in PHP5, so make sure you&#8217;ve got those enabled. 
icestats.php



&#60;?PHP


class icestats &#123;


&#160; &#160; // define connection variables


&#160; &#160; private $host = &#39;scriptsamurai.com&#39;;


&#160; &#160; private $port = 8000;


&#160; &#160; private [...]]]></description>
			<content:encoded><![CDATA[<p>Update:  I&#8217;ve refactored a good deal of the code here to support radio servers with multiple mount points.  It now uses the SimpleXML functions in PHP5, so make sure you&#8217;ve got those enabled. </p>
<p><em>icestats.php</em></p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?PHP</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">class</span> icestats <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">// define connection variables</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="re1">$host</span> <span class="sy0">=</span> <span class="st0">&#39;scriptsamurai.com&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="re1">$port</span> <span class="sy0">=</span> <span class="nu0">8000</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="re1">$user</span> <span class="sy0">=</span> <span class="st0">&#39;username&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="re1">$pass</span> <span class="sy0">=</span> <span class="st0">&#39;password&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="re1">$mnt</span> &nbsp;<span class="sy0">=</span> <span class="st0">&#39;&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> <span class="re1">$fp</span> &nbsp; <span class="sy0">=</span> <span class="st0">&#39;&#39;</span><span class="sy0">;</span> <span class="co1">// class resource used to send/receive data</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> __construct<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">check_server</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> check_server<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// check if the icecast server is even running</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">fp</span> <span class="sy0">=</span> <span class="kw3">fsockopen</span><span class="br0">&#40;</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">host</span><span class="sy0">,</span> <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">port</span><span class="sy0">,</span> <span class="sy0">&amp;</span><span class="re1">$errno</span><span class="sy0">,</span> <span class="sy0">&amp;</span><span class="re1">$errstr</span><span class="sy0">,</span> <span class="nu0">10</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// wait ten seconds</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">is_resource</span><span class="br0">&#40;</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">fp</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> check_station<span class="br0">&#40;</span><span class="re1">$mount</span><span class="sy0">=</span><span class="st0">&#39;&#39;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">empty</span><span class="br0">&#40;</span><span class="re1">$mount</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">mnt</span> <span class="sy0">=</span> <span class="re1">$mount</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">fputs</span><span class="br0">&#40;</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">fp</span><span class="sy0">,</span> <span class="st0">&quot;GET $mount HTTP/1.0<span class="es0">\r</span><span class="es0">\n</span>User-Agent: PHP5/Icecast2 Checker (PHP5/scriptsamurai.com)<span class="es0">\r</span><span class="es0">\n</span>Host: &quot;</span><span class="sy0">.</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">host</span><span class="sy0">.</span><span class="st0">&quot;<span class="es0">\r</span><span class="es0">\n</span><span class="es0">\r</span><span class="es0">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$result</span> <span class="sy0">=</span> <span class="kw3">fgets</span><span class="br0">&#40;</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">fp</span><span class="sy0">,</span> <span class="nu0">255</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">fclose</span><span class="br0">&#40;</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">fp</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw3">strstr</span><span class="br0">&#40;</span><span class="re1">$result</span><span class="sy0">,</span> <span class="st0">&#39;200 OK&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">function</span> pull_stats<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re1">$file</span> <span class="sy0">=</span> <span class="kw3">fopen</span><span class="br0">&#40;</span><span class="st0">&#39;http://&#39;</span><span class="sy0">.</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">user</span><span class="sy0">.</span><span class="st0">&#39;:&#39;</span><span class="sy0">.</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">pass</span><span class="sy0">.</span><span class="st0">&#39;@&#39;</span><span class="sy0">.</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">host</span><span class="sy0">.</span><span class="st0">&#39;:&#39;</span><span class="sy0">.</span><span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">port</span><span class="sy0">.</span><span class="st0">&#39;/admin/stats.xml&#39;</span><span class="sy0">,</span> <span class="st0">&#39;r&#39;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// $file is a valid stream</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$stats</span> <span class="sy0">=</span> stream_get_contents<span class="br0">&#40;</span><span class="re1">$file</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">fclose</span><span class="br0">&#40;</span><span class="re1">$file</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// load raw XML stats into a SimpleXML object and then parse out just the mount-point we ask for, or return an error.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$parsed</span> <span class="sy0">=</span> <span class="kw2">new</span> SimpleXMLElement<span class="br0">&#40;</span><span class="re1">$stats</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="kw3">unset</span><span class="br0">&#40;</span><span class="re1">$stats</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$key</span> <span class="sy0">=</span> <span class="kw2">null</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$mount_points</span> <span class="sy0">=</span> <span class="re1">$parsed</span><span class="sy0">-&gt;</span><span class="me1">xpath</span><span class="br0">&#40;</span><span class="st0">&#39;//source&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">foreach</span> <span class="br0">&#40;</span><span class="re1">$mount_points</span> <span class="kw1">as</span> <span class="re1">$mount_index</span> <span class="sy0">=&gt;</span> <span class="sy0">&amp;</span><span class="re1">$mount_point</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$mount</span> <span class="sy0">=</span> <span class="br0">&#40;</span><span class="re1">$parsed</span><span class="sy0">-&gt;</span><span class="me1">source</span><span class="br0">&#91;</span><span class="re1">$mount_index</span><span class="br0">&#93;</span><span class="sy0">-&gt;</span><span class="me1">attributes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re1">$mount</span> <span class="sy0">=</span> <span class="sy0">&amp;</span><span class="re1">$mount</span><span class="br0">&#91;</span><span class="st0">&#39;mount&#39;</span><span class="br0">&#93;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$mount</span> <span class="sy0">==</span> <span class="re1">$this</span><span class="sy0">-&gt;</span><span class="me1">mnt</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re1">$key</span> <span class="sy0">=</span> <span class="re1">$mount_index</span><span class="sy0">;</span> <span class="kw1">break</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// return correct array for this mount point.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#40;</span><span class="re1">$key</span> <span class="sy0">!==</span> <span class="kw2">null</span><span class="br0">&#41;</span> ? <span class="re1">$parsed</span><span class="sy0">-&gt;</span><span class="me1">source</span><span class="br0">&#91;</span><span class="re1">$mount_index</span><span class="br0">&#93;</span> <span class="sy0">:</span> <span class="kw2">false</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">?&gt;</span></div>
</li>
</ol>
</div>
<p>this next script is just a demo of how to access the above - you&#8217;ll want to take a look at the print_r($stats) and see which fields you want returned for that mount point, then style them accordingly.</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="kw2">&lt;?PHP</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">require_once</span><span class="br0">&#40;</span><span class="st0">&#39;icestats.php&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$r</span> <span class="sy0">=</span> <span class="kw2">new</span> icestats<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="re1">$stats</span> <span class="sy0">=</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$r</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$r</span><span class="sy0">-&gt;</span><span class="me1">check_station</span><span class="br0">&#40;</span><span class="st0">&#39;/pirate-radio&#39;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re1">$stats</span> <span class="sy0">=</span> <span class="re1">$r</span><span class="sy0">-&gt;</span><span class="me1">pull_stats</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&#39;&lt;pre&gt;&#39;</span><span class="sy0">;</span> <span class="kw3">print_r</span><span class="br0">&#40;</span><span class="re1">$stats</span><span class="br0">&#41;</span><span class="sy0">;</span> </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&#39;There was a problem retrieving the station information.&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&#39;The requested station is currently unavailable.&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">echo</span> <span class="st0">&#39;The radio server is currently unavailable.&#39;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">?&gt;</span></div>
</li>
</ol>
</div>
<p>A final note, when accessing $stats in anything other than print_r(), use $stats-&gt;property_name, because $stats is a SimpleXML object.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.th1nk.com/code/how-to-pull-statistics-from-icecast-with-php/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
