Changeset 1973

Show
Ignore:
Timestamp:
10/10/07 03:35:55
Author:
miyagawa
Message:

support script:path in Subscription::File

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Subscription/File.pm

    r858 r1973  
    2323    $uri->scheme('file') unless $uri->scheme; 
    2424 
    25     for ( split /\n/, Plagger::Util::load_uri($uri)) { 
     25    my $output; 
     26    if ($uri->scheme eq 'script') { 
     27        my $script = $uri->opaque; 
     28        $script =~ s!^//!!; 
     29        $script = URI::Escape::uri_unescape($script); 
     30        $output = qx($script); 
     31        if ($?) { 
     32            $context->log(error => "Error happend while executing '$script': $?"); 
     33            return; 
     34        } 
     35    } else { 
     36        $output = Plagger::Util::load_uri($uri); 
     37    } 
     38 
     39    for ( split /\n/, $output ) { 
    2640        s/\#.*//; 
    2741        next if /^\s*$/;