First off DO NOT use the attached script unless you are running svn 15222 or higher.<br><br>Second you will need to run the following SQL to set the correct submittion settings <br>for MythMusic (replace the HOSTNAME part)...
<br><br>INSERT INTO settings (value,data,hostname) VALUE(&#39;MusicLastPlayDelay&#39;, &#39;240&#39;, &#39;HOSTNAME&#39;);<br><br>This is so that songs do not get marked as played unless they have been playing for<br>at least 240 seconds or half their length, whichever comes first. It&#39;s important to do the
<br>above as those rules are set by <a href="http://last.fm/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">last.fm</a> and if you break them then the script could get <br>banned.<br><br>On my machine I&#39;ve set the script to run every 5mins in a cronjob but before it&#39;s run for
<br>the first time you&#39;ll need to...<br><br>1) Change these lines to the relevant username/password for <a href="http://last.fm/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">last.fm</a> and mysql
<br>my $lastfmuser&nbsp; = &#39;USERNAME&#39;;<br>my $lastfmpass&nbsp; = &#39;PASSWORD&#39;;
<br>my $dbuser&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#39;mythtv&#39;;<br>my $dbpass&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = &#39;mythtv&#39;;<br><br>2) Run this line in the same folder as the script to create a &quot;lastrun&quot; file.<br>date +%s &gt; lastrun<br><br>It will stick the current time in the file, then everything you play in mythmusic from now
<br>on will get submitted.<br><br>For testing you can also run the script as...<br>./mythlastfm.pl debug<br>...and it will output some debug status messages.<br><br>Please let us know if you have any suggestions/improvements.
<br><br>Thanks,<br>Ash<br>