Ok, the time has come for me to make an MP3 disk, believe it or not :-)
First, prepare the directory structure:
mkdir green primary
Then, I wrote the following script to get the hot items:
------------------------------ #! /usr/bin/perl
%dir_lookup = ("primary" => 2, "green" => 1);$max_green = 340; $max_primary = 285;
for ($i = 1; $i <= $max_green; $i++)
{
get_hymn($i, "green");
}for ($i = 1; $i < $max_primary; $i++)
{
get_hymn($i, "primary");
}sub get_hymn
{
my ($num,$sub_dir) = @_;
return 1 if (try_hymn($num,$sub_dir));
return (try_hymn($num."a",$sub_dir) && try_hymn($num."b",$sub_dir));
}sub try_hymn
{
my ($num,$sub_dir) = @_;
my ($src,$dest);
$src = "http://broadcast.lds.org/churchmusic/MP3/1/".
$dir_lookup{$sub_dir}."/words/$num.mp3";
$dest = "$sub_dir/$num.mp3";
return 1 if (-f $dest);
$success = (system("wget -O $dest -N $src") == 0);
unlink($dest) unless ($success);
}------------------------------
Afterwards:
mkisofs -J -o tmp/hymns.iso hymns cdrecord -data dev=0,0,0 tmp/hymns.iso
Then I stuck the newly burned CD into our DVD player, which also has the MP3 support to try the MP3 part of it for the first time. The kids woke up to the words of a hymn:
The day dawn is breaking, the world is awaking...
:-)
-- Sasha Pachev Create online surveys at http://www.surveyz.com/
____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list
