dakedesu has asked for the wisdom of the Perl Monks concerning the following question:

I read somewhere about a perl monk who had a perl script interacting with a MP3 player as his alarm clock, where at a certain time, music would start to play.

I am wondering what sorts of modules I would need to create something similar to this, and am wonder what the other monks would recommend.

No this is not homework, if it was, I would wonder about the teacher's sanity, I just think it would be really cool if I could program this :)

Summary: What modules do I want?

DakeDesu teh Confused Werewolf.
In perl, only those who are bless'd are treated as objects
(Webpages under construction)

Replies are listed 'Best First'.
Re: Module for webcast alarm clock daemon
by jepri (Parson) on Apr 01, 2002 at 12:54 UTC
    If you are running linux, try:

    prompt> at 8am at> /usr/bin/xmms http://url.to.music/ at> <control-D>

    I use this quite often to get up. There's a gnome front end as well.

    In desperation, when I get too tired to figure out at, I'll type:

    perl -e 'sleep 4*60**2;`xmms loud_song.mp3`'

    Substitute real player or flash player as necessary. Under windows NT you can use the system scheduler to do the same thing as at.

    Most of the complexity in these things comes from programming the front end. If you want to make a full scheduler (reinventing wheel alert), use Date::Manip to figure out when you want an action to occur, then write a program that lets users input actions and times. Then check to see if a action should have occurred, say once per second and off you go.

    There isn't really a need for too many modules. If you are trying to get something tricky off a webpage, you will need LWP, but apart from that and Date::Manip, you don't need too much.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

Re: Module for webcast alarm clock daemon
by belg4mit (Prior) on Apr 01, 2002 at 16:32 UTC
    a cron; in perl. Though there is no mention of MP3, you could certainly do it.

    --
    perl -pe "s/\b;([st])/'\1/mg"

Re: Module for webcast alarm clock daemon
by dakedesu (Scribe) on Apr 07, 2002 at 21:21 UTC

    update: Well, after checking out the site I wanted the webcast from, they are apparently doing something daft like using their own plugin for it. It would also appear that they have a bunch of *grumble* windows experts *mutter, mumble, grumble* working for their site, seeing as how the plugin is currently only for Internet Explorer for Windows (Though it will work for Mozilla, just you have to install it with IE).

    If I was not as much of a lazy bum, I would request the specs to the format, so I could write a server for XMMS.

    DakeDesu teh Confused Werewolf.
    In perl, only those who are bless'd are treated as objects
    (Webpages under construction)