<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Last.FM submissions with Audacious</title>
	<atom:link href="http://hash-bang.net/2010/06/lastfm-with-audacious/feed/" rel="self" type="application/rss+xml" />
	<link>http://hash-bang.net/2010/06/lastfm-with-audacious/</link>
	<description>The start of all wonderful things</description>
	<lastBuildDate>Sun, 20 Nov 2011 20:29:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: mc</title>
		<link>http://hash-bang.net/2010/06/lastfm-with-audacious/comment-page-1/#comment-3646</link>
		<dc:creator>mc</dc:creator>
		<pubDate>Tue, 05 Apr 2011 03:52:36 +0000</pubDate>
		<guid isPermaLink="false">http://hash-bang.net/?p=162#comment-3646</guid>
		<description>Fixed up the previous comment by enclosing the code in &lt;code&gt; tags. Wordpress seems to understand that anything within them is not to be trifled with.</description>
		<content:encoded><![CDATA[<p>Fixed up the previous comment by enclosing the code in &lt;code&gt; tags. WordPress seems to understand that anything within them is not to be trifled with.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://hash-bang.net/2010/06/lastfm-with-audacious/comment-page-1/#comment-3645</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Tue, 05 Apr 2011 03:44:30 +0000</pubDate>
		<guid isPermaLink="false">http://hash-bang.net/?p=162#comment-3645</guid>
		<description>(the commenting system was surprisingly kind to this script - the only thing missing is the usage line - but you&#039;ll have to turn all the inverted commas back to ones that bash understands)</description>
		<content:encoded><![CDATA[<p>(the commenting system was surprisingly kind to this script &#8211; the only thing missing is the usage line &#8211; but you&#8217;ll have to turn all the inverted commas back to ones that bash understands)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andrew</title>
		<link>http://hash-bang.net/2010/06/lastfm-with-audacious/comment-page-1/#comment-3644</link>
		<dc:creator>andrew</dc:creator>
		<pubDate>Tue, 05 Apr 2011 03:42:27 +0000</pubDate>
		<guid isPermaLink="false">http://hash-bang.net/?p=162#comment-3644</guid>
		<description>Thanks for this.
i made a couple of changes for it to work for me:

first of all, the download came dos-formatted, so i had to run dos2unix on it.

then, because i have customised my audacious playlist settings i had to change the lines which split artist and song.  my playlist looks like:
${track-number}:${title} ${?album: - ${album}}${?artist: - ${artist}} ${?year: [${year}]}
which produces titles like
 1:Everyday - And Then Nothing Turned Itself Inside Out - Yo La Tengo [2000]

and finally, i&#039;m not running lastfmsubmit as daemon, so i just call it for each submission

so here is my scrobble script:
&lt;code&gt;
#!/bin/bash

if [ ! -x &#039;/usr/lib/lastfmsubmitd/lastfmsubmitd&#039; ]; then
	echo &quot;LastFMSubmitD does not appear to exist on this machine&quot;
	echo &quot;You can install it using Apt or Yum&quot;
	exit 1
fi
if [ &quot;$#&quot; == 0 ]; then
	echo &#039;Usage: scrobble &quot; - &quot; &quot;&quot;&#039;
	exit 1
fi


#ARTIST=${1%% - *}
#SONG=${1##* - }
# andrew has audacious set to print {track}:{Song} - {album} - {artist} [{year}]  all this would be better done with sed, but i like trying it in bash
# split $1 and remember everything after the colon
artistsongyear=${1##*:}
# split that and remember everything before the bracked (no good for songs with brackets!)
songalbumartist=${artistsongyear%% [*}
# split that on the dashes which separates song - album - artist
ARTIST=${songalbumartist##* - }
SONG=${songalbumartist%% - *}
songalbum=${songalbumartist#* - }
ALBUM=${songalbum%% - *}
# length is in milliseconds
LENGTH=$[ $2 / 1000 ]
echo &quot;ARTIST = [$ARTIST]&quot;
echo &quot;ALBUM = [$ALBUM]&quot;
echo &quot;SONG = [$SONG]&quot;
echo &quot;LENGTH = [$LENGTH]&quot;

#this will log the song details to /var/spool/lastfm
/usr/lib/lastfmsubmitd/lastfmsubmit  --artist &quot;$ARTIST&quot; --title &quot;$SONG&quot; --length &quot;$LENGTH&quot;
# it&#039;s made to be run as a daemon, but just as easy to run once
/usr/lib/lastfmsubmitd/lastfmsubmitd&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for this.<br />
i made a couple of changes for it to work for me:</p>
<p>first of all, the download came dos-formatted, so i had to run dos2unix on it.</p>
<p>then, because i have customised my audacious playlist settings i had to change the lines which split artist and song.  my playlist looks like:<br />
${track-number}:${title} ${?album: &#8211; ${album}}${?artist: &#8211; ${artist}} ${?year: [${year}]}<br />
which produces titles like<br />
 1:Everyday &#8211; And Then Nothing Turned Itself Inside Out &#8211; Yo La Tengo [2000]</p>
<p>and finally, i&#8217;m not running lastfmsubmit as daemon, so i just call it for each submission</p>
<p>so here is my scrobble script:<br />
<code><br />
#!/bin/bash</p>
<p>if [ ! -x '/usr/lib/lastfmsubmitd/lastfmsubmitd' ]; then<br />
	echo "LastFMSubmitD does not appear to exist on this machine"<br />
	echo "You can install it using Apt or Yum"<br />
	exit 1<br />
fi<br />
if [ "$#" == 0 ]; then<br />
	echo 'Usage: scrobble " - " ""'<br />
	exit 1<br />
fi</p>
<p>#ARTIST=${1%% - *}<br />
#SONG=${1##* - }<br />
# andrew has audacious set to print {track}:{Song} - {album} - {artist} [{year}]  all this would be better done with sed, but i like trying it in bash<br />
# split $1 and remember everything after the colon<br />
artistsongyear=${1##*:}<br />
# split that and remember everything before the bracked (no good for songs with brackets!)<br />
songalbumartist=${artistsongyear%% [*}<br />
# split that on the dashes which separates song - album - artist<br />
ARTIST=${songalbumartist##* - }<br />
SONG=${songalbumartist%% - *}<br />
songalbum=${songalbumartist#* - }<br />
ALBUM=${songalbum%% - *}<br />
# length is in milliseconds<br />
LENGTH=$[ $2 / 1000 ]<br />
echo "ARTIST = [$ARTIST]"<br />
echo "ALBUM = [$ALBUM]"<br />
echo "SONG = [$SONG]"<br />
echo "LENGTH = [$LENGTH]"</p>
<p>#this will log the song details to /var/spool/lastfm<br />
/usr/lib/lastfmsubmitd/lastfmsubmit  --artist "$ARTIST" --title "$SONG" --length "$LENGTH"<br />
# it's made to be run as a daemon, but just as easy to run once<br />
/usr/lib/lastfmsubmitd/lastfmsubmitd</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mc</title>
		<link>http://hash-bang.net/2010/06/lastfm-with-audacious/comment-page-1/#comment-2739</link>
		<dc:creator>mc</dc:creator>
		<pubDate>Mon, 14 Jun 2010 21:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://hash-bang.net/?p=162#comment-2739</guid>
		<description>Its great that you have improved the functionality even more.

Would it be possible to get a link back to the original entry though if anyone wants the original?</description>
		<content:encoded><![CDATA[<p>Its great that you have improved the functionality even more.</p>
<p>Would it be possible to get a link back to the original entry though if anyone wants the original?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: n3mo</title>
		<link>http://hash-bang.net/2010/06/lastfm-with-audacious/comment-page-1/#comment-2738</link>
		<dc:creator>n3mo</dc:creator>
		<pubDate>Mon, 14 Jun 2010 11:22:09 +0000</pubDate>
		<guid isPermaLink="false">http://hash-bang.net/?p=162#comment-2738</guid>
		<description>Hey! After writing my own script i searched internet for similar and i found yours. Mine has some features like scrobble after 10 seconds and checking if it&#039;s running again. You can check it here :
http://smali.me/2gb
Ned</description>
		<content:encoded><![CDATA[<p>Hey! After writing my own script i searched internet for similar and i found yours. Mine has some features like scrobble after 10 seconds and checking if it&#8217;s running again. You can check it here :<br />
<a href="http://smali.me/2gb" rel="nofollow">http://smali.me/2gb</a><br />
Ned</p>
]]></content:encoded>
	</item>
</channel>
</rss>

