Difference between revisions of "Rp"
From Organic Design wiki
m (comment better) |
m |
||
Line 19: | Line 19: | ||
$client = LWP::UserAgent->new( cookie_jar => {} ); | $client = LWP::UserAgent->new( cookie_jar => {} ); | ||
− | # | + | # Build sync-list from args, or if none, obtain list from Bender/fileSync article in OD wiki |
if ($#ARGV<0) { | if ($#ARGV<0) { | ||
print "\nRetrieving files specified in OD:Bender/fileSync list...\n"; | print "\nRetrieving files specified in OD:Bender/fileSync list...\n"; | ||
Line 32: | Line 32: | ||
} | } | ||
− | # Retrieve each article and save to specified filepath | + | # Retrieve each article in sync-list and save to specified filepath |
for my $article (keys %articles) { | for my $article (keys %articles) { | ||
print "\t$article\n"; | print "\t$article\n"; |
Revision as of 23:35, 25 July 2006
- !/usr/bin/perl
use HTTP::Request; use LWP::UserAgent; use Cwd;
- Get CWD and determine OS
our $cwd = cwd; our $ux = ($cwd =~ m/^\//); $ux ? $cwd = cwd : $cwd =~ s/\//\\/g; $cwd =~ s/\//\\/g unless $cwd =~ m/^\//; $cwd =~ s/[\\\/]$//g;
- Command to list running peerd's (or null for Win32)
$ps = $ux ? 'ps lx|egrep peerd:' : ; $qxps = qx($ps);
- Set up a www-user-agent and source-url for syncing
$wiki = "http://www.organicdesign.co.nz/wiki/index.php"; $client = LWP::UserAgent->new( cookie_jar => {} );
- Build sync-list from args, or if none, obtain list from Bender/fileSync article in OD wiki
if ($#ARGV<0) { print "\nRetrieving files specified in OD:Bender/fileSync list...\n"; my $fileSync = $client->request(HTTP::Request->new(GET => "$wiki?title=Bender/fileSync&xpath:view:")); $fileSync = $fileSync->content; $fileSync =~ s/<\/ul>.+$//ms;
%articles = $fileSync =~ /
- Retrieve each article in sync-list and save to specified filepath
- Don't do any compilation unless ux
- Compile husk and format output
- Execute compiled result if compiled without any problems