This code is a tiny little perlet I use to quickly tell people what I am listening to online.
Uses XMMS (sorry windows folks) and XMMS InfoPipe.
Would be trivially easy to add to PerlMonksChat or cgi or .signature... and so on.

by request,
brother dep.

#!/usr/bin/perl -w use strict; open INFO, qq./tmp/xmms-info. or die; my %lines; foreach (<INFO>) { if (/^Tunes/) { $lines{choons} = $_ } elsif (/^Curr/) { $lines{curr} = $_ } elsif (/^Posi/) { $lines{posi} = $_ } elsif (/^Titl/) { $lines{titl} = $_ } else { next } } close INFO or die ; foreach (values %lines) { chop }; $lines{choons} =~ s/Tunes in playlist: //; $lines{curr} =~ s/Currently playing: //; $lines{titl} =~ s/Title: //; print qq-($lines{curr}/$lines{choons}) $lines{posi} [ $lines{titl} ]\n +- __END__ Tunes in playlist: 2009 Currently playing: 1 Position: 0:00 Title: A*TEENS - Take a chance on me

Replies are listed 'Best First'.
Re: quick "what im listening to" info
by Anonymous Monk on Mar 11, 2001 at 07:01 UTC
    in xmms under plugins there is a default plugin called libsongchange, i have it write the current title out to a file and at the end of my playlist write out 'nothing'. then i just put the title into my web pages via SSI, or open it, pull it out to a var, and print it in my scripts... accomplishes virtually the same with less code.