MuxScrobbler

Last update on Jun 8, 2008

MuxScrobbler is a script to send your MuxTape (http://muxtape.com) currently playing tracks to last.fm

8th June 2008
Total re-write of the script. Has all previous fixes.
Interface has been re-written. Now, when the script loads it adds a scrobble icon to each song on the page. If you click the icon, it will turn gray and the song will be skipped. You can toggle the action if you accidentally hit it or change your mind. The code is also a lot cleaner.

Some testing has been done, but please report any bugs.

31 May 2008
Updated with new release, includes several fixes:
+ Fixed issue where anything less than 30 seconds cannot be submitted.
+ Added casperbp's fixes for Windows Firefox javascript timer and better code for getting track title.
+ Link to casperbp's blog post about how to install Muxscrobbler: http://lights-retinue.dk/blog/?p=40
+ Out of Alpha release phase, now stable enough to be considered release version

14 May 2008: Fixed bug where songs of exactly 4 mins long were never scrobbled.

The script works on checking which track is currently playing. If the track is less than 240 seconds long, then the script will not submit the play until the track is at least half played. If the track is longer than 240 seconds, it will submit after then.




You could comment on this script if you were logged in.

12 comments Feed-icon

1 point
login to vote
GeekShadow user
Posted Sep 28, 2008

This script work well with OpenTape !

1 point
login to vote
jstn user
Posted Jul 7, 2008
1 point
login to vote
casperbp user
Posted Jul 1, 2008

Muxtape has changed their CSS-layout. The class names of the song-container has changed from "songs" to "stripes" and the songs themselves from "song" to "stripe". The jQuery-queries should be changed to look for these new class-names to make the script functional again. Cheers. :)

1 point
login to vote
digitalspagh... script's author
Posted May 31, 2008

Thanks very much for these fixes casperbp, and thanks for the blog post too! I've added your fixes to the file.

1 point
login to vote
casperbp user
Posted May 26, 2008

Nice script!

I had a problem where I got my track submitted twice or even up to 5 times. I changed the interval to 10 seconds instead of 5 and added a return statement after setting lastid to currentid:

      ...
                  onload: function(responseDetails) {
                    muxscrobbler.vars.sendresponse = responseDetails.responseText.split('\n');
                    if (muxscrobbler.vars.sendresponse[0] == 'OK') {
                      muxscrobbler.vars.lastid = muxscrobbler.vars.currentid
                      el.append('Your song has been scrobbled.');
      		return;
                    } else {
                      throw Error('Unable to scrobble Song');
                      el.append('Unable to scrobble song.');
                    }
                  }
      ...
      

Don't know which of the two did the trick, but I don't get multiple submissions per track any longer. I am running Firefox 2.0.0.14 @ Ubuntu 7.10.

Another small problem I had was when playing tracks with ampersand (&) in the track- or artist-name. Instead of splitting by spaces and joining by '%20', I simply used javascripts escape()-function to URL-escape the track- and artist-name:

      ...
              muxscrobbler.vars.track = el.find('.name').text()
              muxscrobbler.vars.track = muxscrobbler.vars.track.split("\n").join("");
              muxscrobbler.vars.track = muxscrobbler.vars.track.split("-")
              muxscrobbler.vars.currentartists = Trim(muxscrobbler.vars.track[0]);
              muxscrobbler.vars.currentsong = Trim(muxscrobbler.vars.track[1]);
              muxscrobbler.vars.currentartists = escape(muxscrobbler.vars.currentartists);
              muxscrobbler.vars.currentsong = escape(muxscrobbler.vars.currentsong);
              
      ...
      

Apart from that the script works wonders. :-)

1 point
login to vote
Dan1el user
Posted May 21, 2008

OK I tried to edit the script and change the prompt sequence to my own password and it still doesn't work. I'm no expert on programming so I may be doing any stupid thing, but I think it is not running the script from the beggining. It works fine on Firefox, but I like Safari better, I downloaded GreaseKit for Safari and I think the problem may be in there. Thanks...

1 point
login to vote
jongam user
Posted May 21, 2008

Dan1el, try editing the script and add your username and password manually.

1 point
login to vote
Dan1el user
Posted May 18, 2008

Does it work on Leopard?
I'm using a Muxtape standalone player I downloaded from the muxtape blog. It has the Userscripts menu and the script shows as installed, but nothing else happens...

1 point
login to vote
jongam user
Posted May 18, 2008

This was from XP, Firefox 2, EST.

1 point
login to vote
digitalspagh... script's author
Posted May 17, 2008

@jongam - Very weird, the script should be getting UTC time and passing this. I'm not able to confirm this.

Can you tell me what OS your on, and your Timezone, that would be great!

1 point
login to vote
jongam user
Posted May 14, 2008

On second look, it looks as though it's telling last.fm that I listened (will listen?) to the tracks in the future. For example "in 59 minutes" opposed to "2 minutes ago". Seems to be about an hour into the future for all songs. An hour plus the song length possibly? I know it's still in alpha, just making sure you know about this particular issue.

1 point
login to vote
jongam user
Posted May 14, 2008

Works great so far. Thank you so much for this script. I've been hoping for a last.fm/muxtape solution ever since I first used muxtape.

You could comment on this script if you were logged in.