Set your ichat status to your most recent play

I can’t really take credit for this, it’s just a slightly modified version of what’s available from this guy: You can use the instructions provided on that site to get this setup.

I increased the frequency and had to remove the tilde (~) from the path in the cronjob.

#!/usr/bin/env ruby
# Update iChat/Adium status from
# Michael Tyson

# Set username here
Username = 'yourUsername'

require 'net/http'
require 'rexml/document'

# Download timeline XML and extract latest entry
url = "" + Username + "/recenttracks.rss"
xml_data = Net::HTTP.get_response(URI.parse(url)).body
doc    =
latest = doc.root.elements['channel/item/title']
message = '♫ ' + latest.text.gsub(/^[^:]+:s*/, '')

exit if ! message

# Apply to status
script = 'set message to "' + message.gsub(/"/, '\"') + ""n" +
         'tell application "System Events"' + "n" +
         'if exists process "iChat" then tell application "iChat" to set the status message to message' + "n" +
         'if exists process "Adium" then tell application "Adium" to set status message of every account to message' + "n" +
         'end tell' + "n"

IO.popen("osascript", "w") { |f| f.puts(script) }

One thought on “Set your ichat status to your most recent play”

  1. I’m getting this error message when executing the script via terminal:

    “228:242: syntax error: A identifier can’t go after this identifier. (-2740)”
    Any ideas?

    Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: