Posts Tagged ‘code’

Update to My Last.fm Scrobbling Test

I spent a bit of time this evening updating my Last.fm scrobbler (if you can call it that), which I have written about before.

It simply makes it a lot easier to use: enter your username and password, click the button (I know the enter key doesn’t work, and I hate myself for not being able to fix it). You’ll move to a page where you need to enter three fields (artist, track and length) and click submit. Done. When compared to the old method, it’s several thousand times better.

I feel much happier. I’m trying to do something interesting with it involving Delicious, but we’ll see if I can get the code working or not…

By the way: not including a giant, massive link to the new page is one of the smartest things I’ve ever done. *facepalm*.

Here’s One I Made Earlier

This is hardly complicated, but it’s something that’s been bugging me. A few minutes later, tada: a script that will open the Last.fm page of the currently playing iTunes track.


tell application "iTunes"
  try
    set theArtist to artist of current track
    set theSong to name of current track
  end try
end tell

tell application "System Events"
  open location "http://www.last.fm/music/" & theArtist & "/_/" & theSong
end tell

–– Alex Muller
–– http://alex.mullr.net/blog/
–– Do what you want with it…
–– Sunday November 9th, 2008

Copy and paste the above into Script Editor (Applications > AppleScript) on the Mac, and hit compile. As the comment in the code says, this is hardly my finest piece of work (at least, I hope it isn’t), so I’m not too bothered what you do with it. Enjoy it, whatever happens…