Valknut has a /sh chat command that runs a program, and sends the text that the program prints out to the hub as chat, as if you said it.
[19:41:38] <VALKNUT> /sh date
[19:41:38] <ejs> Fri Dec 5 19:41:38 GMT 2008
Many media playing programs provide some way for another program to get info about the current song playing, exactly how varies, and usually you need to use a small script (bash, perl, python etc.) to produce the exact message you want.
You can then define some short command e.g. "/a" to be "/sh amarok2-now-playing".
The provided programs all produce slightly different output. The exact version of the media player is not required, that is just the version I had.
Audacious 1.5.1 - bash script
Audacious provides "audtool", the script formats and arranges the output.
Xmms 1.2.11 - C program
Compile: gcc -Wall -O2 -g `xmms-config --cflags` `xmms-config --libs` -o xmms-now-playing xmms-now-playing.c
Xmms provides libxmms for C programs to use, alternatively use XMMS Announcer.
Rhythmbox 0.11.6 - bash script
Rhythmbox provides "rhythmbox-client", you do not really need the script, just use "rhythmbox-client --print-playing-format ...". The bash script lists the items available for the format string.
Kaffeine 0.8.7 - bash script
This version of kaffeine uses KDE 3.5, so uses the "dcop" command, which is very easy to use.
Amarok 1.4.10 - bash script
KDE 3.5, the "dcop" command.
Amarok 1.98 , VLC 0.9.8a, maybe more - C++ program
Compile: g++ -Wall -O2 -g `pkg-config --cflags QtCore QtDBus` `pkg-config --libs QtCore QtDBus` -o amarok2-now-playing amarok2-now-playing.cpp
Amarok 2 uses KDE 4, which replaced dcop with dbus.
You can enable the dbus interface in VLC and then run "amarok2-now-playing vlc".
If run with an argument other than "vlc" or "amarok", that is the dbus service name, run "qdbus" for a list, "org.mpris.audacious" is Audacious, but "audtool" is more appropriate.
TODO: add some kind of --format option to this program, unless a better program already exists somewhere.
Alternatively, the qdbus program could be used in the same way the dcop program was, in a script.