Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Blimey, glad I grabbed that Oasis album when I did (grin). I just visited the site and was greeted by a blank page with the following line:

    Lmp3 will be closed and will never come back!

    • The good news is that their FTP site is still live. The bad news is that it doesn't give directory listings. The good news is that I snarfed some paths and filenames from the site while it was live.

      I'll give out the code once I figure out how to detect an aborted get(). It seems like every second to third get is bungholed, and I'm not sure why.

      --Nat

      • Re:Gone (Score:2, Informative)

        by briac (2526) on 2002.08.20 7:50 (#11971) Homepage

        Perhaps you could use the $ua->request($req, $callback) variant to detect aborted downloads. I use something like this:

        my ($bytes_read, $total_size);
        my $res = $ua->request(
            HTTP::Request->new( GET => $url ),
              sub {
                $bytes_read  += length( $_[0] );
                $total_size ||= $_[1]->content_length;
                print ( shift() );
              }
            );

        if ( $bytes_read != $total_size ){
            print "Aborted"
        }
        elsif ( $res->is_success ) {
            print "Ok"
        }
        else {
            print $res->status_line
        }
        --
        -- briac