<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Implementing &#8220;Bob&#8217;s Listening To&#8221;</title>
	<atom:link href="http://www.numenware.com/article/249/feed" rel="self" type="application/rss+xml" />
	<link>http://www.numenware.com/article/249</link>
	<description>Religion. Brain. Dogen. Language. Japan.</description>
	<pubDate>Fri, 05 Sep 2008 08:43:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Paul Henry</title>
		<link>http://www.numenware.com/article/249#comment-767</link>
		<dc:creator>Paul Henry</dc:creator>
		<pubDate>Sun, 01 Oct 2006 23:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-767</guid>
		<description>For multiple squeezeboxes, don&#8217;t forget to query the right one!

Modify wget source as http://localhost:9000/xml/status.xml?player=name_of_player</description>
		<content:encoded><![CDATA[<p>For multiple squeezeboxes, don&#8217;t forget to query the right one!</p>
<p>Modify wget source as <a href="http://localhost:9000/xml/status.xml?player=name_of_player" rel="nofollow">http://localhost:9000/xml/status.xml?player=name_of_player</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hywel Mallett</title>
		<link>http://www.numenware.com/article/249#comment-95</link>
		<dc:creator>Hywel Mallett</dc:creator>
		<pubDate>Fri, 18 Mar 2005 15:54:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-95</guid>
		<description>Thanks Bob!
I&#8217;ve implemented this myself, in about 10 minutes (including installing libxslt). My scenarios easier than yours, as the web server and slimserver are the same, so mine just creates the file in the correct location. Great instructions though!
H</description>
		<content:encoded><![CDATA[<p>Thanks Bob!<br />
I&#8217;ve implemented this myself, in about 10 minutes (including installing libxslt). My scenarios easier than yours, as the web server and slimserver are the same, so mine just creates the file in the correct location. Great instructions though!<br />
H</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel S Aufrecht</title>
		<link>http://www.numenware.com/article/249#comment-55</link>
		<dc:creator>Joel S Aufrecht</dc:creator>
		<pubDate>Wed, 01 Dec 2004 23:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-55</guid>
		<description>Here\&#8217;s a version of slim-putsong.xsl which does not output the \&#8221;by\&#8221; or \&#8221;from\&#8221; text if artist or album is missing:










  
  
  
  0\&#8221;&gt;
    &lt;b&gt;&lt;/b&gt;
  
  0\&#8221;&gt;
    by &lt;b&gt;&lt;/b&gt;
  
  0\&#8221;&gt;
    from  &lt;b&gt;&lt;/b&gt;</description>
		<content:encoded><![CDATA[<p>Here\&#8217;s a version of slim-putsong.xsl which does not output the \&#8221;by\&#8221; or \&#8221;from\&#8221; text if artist or album is missing:</p>
<p>  0\&#8221;><br />
    <b></b></p>
<p>  0\&#8221;><br />
    by <b></b></p>
<p>  0\&#8221;><br />
    from  <b></b></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel Aufrecht</title>
		<link>http://www.numenware.com/article/249#comment-42</link>
		<dc:creator>Joel Aufrecht</dc:creator>
		<pubDate>Mon, 01 Nov 2004 19:42:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-42</guid>
		<description>Here\&#8217;s a modified version of the bash script, which uses ssh instead of ftp:
#!/bin/sh

# shell script to create &lt;span class="caps"&gt;HTML&lt;/span&gt; of current song playing on Squeezebox,
# originally from http://bob.myers.name/blog/article/249
# modified by Joel Aufrecht Oct 2004 to use scp

# check for input
if [[ -z \&#8221;$1\&#8221; &#124;&#124; -z \&#8221;$2\&#8221; ]]  
    then
    echo \&#8221;Usage: putsong.sh target-destination identity-file
Example: To upload a song every 3 minutes, using a dedicated ssh 
         account called \\\&#8221;upload\\\&#8221;, put this in your crontab:

         */3 * * * * sh /etc/slimserver/putsong.sh upload@foo.bar:/tmp/song.html /home/me/.ssh/upload\&#8221;
    exit
fi


&lt;span class="caps"&gt;STATUS&lt;/span&gt;=/tmp/status.xml
&lt;span class="caps"&gt;STATUS&lt;/span&gt;_&lt;span class="caps"&gt;HTML&lt;/span&gt;=/tmp/song.html

wget&#8212;quiet&#8212;output-document=$&lt;span class="caps"&gt;STATUS&lt;/span&gt; http://localhost:9000/xml/status.xml
# if song is not playing, do nothing
if [ \&#8221;`grep -c \&#8217;playing\&#8217; $&lt;span class="caps"&gt;STATUS&lt;/span&gt;`\&#8221; -eq \&#8221;1\&#8221; ]
    then
    xsltproc -o $&lt;span class="caps"&gt;STATUS&lt;/span&gt;_&lt;span class="caps"&gt;HTML&lt;/span&gt;&#8212;novalid /etc/slimserver/slim-putsong.xsl $&lt;span class="caps"&gt;STATUS&lt;/span&gt;
    echo \&#8221;at `date`\&#8221; &gt;&gt; $&lt;span class="caps"&gt;STATUS&lt;/span&gt;_&lt;span class="caps"&gt;HTML&lt;/span&gt;
    scp -i $2 $&lt;span class="caps"&gt;STATUS&lt;/span&gt;_&lt;span class="caps"&gt;HTML&lt;/span&gt; $1
fi</description>
		<content:encoded><![CDATA[<p>Here\&#8217;s a modified version of the bash script, which uses ssh instead of ftp:<br />
#!/bin/sh</p>
<p># shell script to create <span class="caps">HTML</span> of current song playing on Squeezebox,<br />
# originally from <a href="http://bob.myers.name/blog/article/249" rel="nofollow">http://bob.myers.name/blog/article/249</a><br />
# modified by Joel Aufrecht Oct 2004 to use scp</p>
<p># check for input<br />
if [[ -z \&#8221;$1\&#8221; || -z \&#8221;$2\&#8221; ]]<br />
    then<br />
    echo \&#8221;Usage: putsong.sh target-destination identity-file<br />
Example: To upload a song every 3 minutes, using a dedicated ssh<br />
         account called \\\&#8221;upload\\\&#8221;, put this in your crontab:</p>
<p>         */3 * * * * sh /etc/slimserver/putsong.sh <a href="mailto:upload@foo.bar">upload@foo.bar</a>:/tmp/song.html /home/me/.ssh/upload\&#8221;<br />
    exit<br />
fi</p>
<p><span class="caps">STATUS</span>=/tmp/status.xml<br />
<span class="caps">STATUS</span>_<span class="caps">HTML</span>=/tmp/song.html</p>
<p>wget&#8212;quiet&#8212;output-document=$<span class="caps">STATUS</span> <a href="http://localhost:9000/xml/status.xml" rel="nofollow">http://localhost:9000/xml/status.xml</a><br />
# if song is not playing, do nothing<br />
if [ \&#8221;`grep -c \&#8217;playing\&#8217; $<span class="caps">STATUS</span>`\&#8221; -eq \&#8221;1\&#8221; ]<br />
    then<br />
    xsltproc -o $<span class="caps">STATUS</span>_<span class="caps">HTML</span>&#8212;novalid /etc/slimserver/slim-putsong.xsl $<span class="caps">STATUS</span><br />
    echo \&#8221;at `date`\&#8221; >> $<span class="caps">STATUS</span>_<span class="caps">HTML</span><br />
    scp -i $2 $<span class="caps">STATUS</span>_<span class="caps">HTML</span> $1<br />
fi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tamagen</title>
		<link>http://www.numenware.com/article/249#comment-24</link>
		<dc:creator>tamagen</dc:creator>
		<pubDate>Fri, 04 Jun 2004 12:34:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-24</guid>
		<description>A quick and dirty approach would be to read the &lt;span class="caps"&gt;XML&lt;/span&gt; from a php page on your web server, assuming you can get access to the slimserver http server from your normal web server - you may need to poke a hole through a firewall.

Something like this would work in that case (change localhost to the name or ip address of your slimserver or external nat router interface etc., and since you can\&#8217;t use angle brackets here replace the strings &lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt; and &lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt; with left and right angle brackets respectively):

&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;?
$xml = fread(fopen(\&#8221;http://localhost:9000/xml/status.xml\&#8221;,r),9999);
if (eregi(\&#8221;&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;playmode&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;playing\&#8221;,$xml)) {
	if (preg_match(\&#8221;/&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;title&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;([^&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;]*)&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;\\/title&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;.*?&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;artist&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;(.*?)&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;\\/artist&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;.*?&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;album&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;(.*?)&lt;span class="caps"&gt;LEFTBRACKET&lt;/span&gt;\\/album&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;/s\&#8221;, $xml, $m)) {
		$track = $m[1] . \&#8221; by \&#8221; . $m[2] . \&#8221; (Album: \&#8221; . $m[3] . \&#8221;)\&#8221;;
	}
	echo \&#8221;I am listening to: $track\&#8221;;
}
?&lt;span class="caps"&gt;RIGHTBRACKET&lt;/span&gt;</description>
		<content:encoded><![CDATA[<p>A quick and dirty approach would be to read the <span class="caps">XML</span> from a php page on your web server, assuming you can get access to the slimserver http server from your normal web server - you may need to poke a hole through a firewall.</p>
<p>Something like this would work in that case (change localhost to the name or ip address of your slimserver or external nat router interface etc., and since you can\&#8217;t use angle brackets here replace the strings <span class="caps">LEFTBRACKET</span> and <span class="caps">RIGHTBRACKET</span> with left and right angle brackets respectively):</p>
<p><span class="caps">LEFTBRACKET</span>?<br />
$xml = fread(fopen(\&#8221;http://localhost:9000/xml/status.xml\&#8221;,r),9999);<br />
if (eregi(\&#8221;<span class="caps">LEFTBRACKET</span>playmode<span class="caps">RIGHTBRACKET</span>playing\&#8221;,$xml)) {<br />
	if (preg_match(\&#8221;/<span class="caps">LEFTBRACKET</span>title<span class="caps">RIGHTBRACKET</span>([^<span class="caps">LEFTBRACKET</span>]*)<span class="caps">LEFTBRACKET</span>\\/title<span class="caps">RIGHTBRACKET</span>.*?<span class="caps">LEFTBRACKET</span>artist<span class="caps">RIGHTBRACKET</span>(.*?)<span class="caps">LEFTBRACKET</span>\\/artist<span class="caps">RIGHTBRACKET</span>.*?<span class="caps">LEFTBRACKET</span>album<span class="caps">RIGHTBRACKET</span>(.*?)<span class="caps">LEFTBRACKET</span>\\/album<span class="caps">RIGHTBRACKET</span>/s\&#8221;, $xml, $m)) {<br />
		$track = $m[1] . \&#8221; by \&#8221; . $m[2] . \&#8221; (Album: \&#8221; . $m[3] . \&#8221;)\&#8221;;<br />
	}<br />
	echo \&#8221;I am listening to: $track\&#8221;;<br />
}<br />
?<span class="caps">RIGHTBRACKET</span></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://www.numenware.com/article/249#comment-18</link>
		<dc:creator>Johan</dc:creator>
		<pubDate>Sat, 08 May 2004 08:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-18</guid>
		<description>Well i have my server running at home and have the info available. So i don\&#8217;t need to use wget. &lt;span class="caps"&gt;XSLT&lt;/span&gt; i have got working. I can use scheduling in windows to run a batch programme ever so often. My problem now is to get the xsltproc to work with the &lt;span class="caps"&gt;XML&lt;/span&gt; programme you have written. Where do you put the data the &lt;span class="caps"&gt;XML&lt;/span&gt; proc needs? I can\&#8217;t find any location information of the input and export file.</description>
		<content:encoded><![CDATA[<p>Well i have my server running at home and have the info available. So i don\&#8217;t need to use wget. <span class="caps">XSLT</span> i have got working. I can use scheduling in windows to run a batch programme ever so often. My problem now is to get the xsltproc to work with the <span class="caps">XML</span> programme you have written. Where do you put the data the <span class="caps">XML</span> proc needs? I can\&#8217;t find any location information of the input and export file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Myers</title>
		<link>http://www.numenware.com/article/249#comment-17</link>
		<dc:creator>Bob Myers</dc:creator>
		<pubDate>Thu, 06 May 2004 18:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-17</guid>
		<description>On Windows, I\&#8217;d recommend doing this under &lt;a href=\"http://www.cygwin.com\"&gt;Cygwin&lt;/a&gt;. That will give you all the pieces you need, including wget (to retrieve the information from the SlimServer), xslt (to transform it), and cron (to run the script every so often).</description>
		<content:encoded><![CDATA[<p>On Windows, I\&#8217;d recommend doing this under <a href=\"http://www.cygwin.com\">Cygwin</a>. That will give you all the pieces you need, including wget (to retrieve the information from the SlimServer), xslt (to transform it), and cron (to run the script every so often).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan</title>
		<link>http://www.numenware.com/article/249#comment-16</link>
		<dc:creator>Johan</dc:creator>
		<pubDate>Tue, 04 May 2004 15:17:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.numenware.com/article/249#comment-16</guid>
		<description>Hold it.... You r going to fast for me... ;-)

I am using an windows machine and am not a wizard in programming... I\&#8217;ll get there in the end... How can I achieve this on my machine... Will/can you help me?

p.s. i have &lt;span class="caps"&gt;XSLT&lt;/span&gt;/&lt;span class="caps"&gt;XML&lt;/span&gt; &lt;span class="caps"&gt;PHP&lt;/span&gt; &lt;span class="caps"&gt;APACHE&lt;/span&gt; installed and working...</description>
		<content:encoded><![CDATA[<p>Hold it&#8230;. You r going to fast for me&#8230; <img src='http://www.numenware.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I am using an windows machine and am not a wizard in programming&#8230; I\&#8217;ll get there in the end&#8230; How can I achieve this on my machine&#8230; Will/can you help me?</p>
<p>p.s. i have <span class="caps">XSLT</span>/<span class="caps">XML</span> <span class="caps">PHP</span> <span class="caps">APACHE</span> installed and working&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
