3 #$0 http://www.codeproject.com/KB/cpp/SDIMultiSplit_Part1.aspx?display=Print
4 #$0 http://www.codeproject.com/KB/mobile/CHMReader.aspx
21 # $r =~ s/\.aspx$/\.htm/g;
27 open FI
,"<",$file or return undef;
29 if(/\<\s*title\s*\>\s*([^\<\>]+)\s*\</) {
31 $title =~ s/^CodeProject:?\s*//;
32 $title =~ s/\s*Free source code and.*$//;
52 my @wget = ("wget","-N","-nH","-p","-k","-E","-t",3);
55 push @wget,join(",",@exclude);
57 return (system(@wget,$url)==0);
63 $url =~ s/\.aspx.*/\.aspx\?display=PrintAll/;
64 my $file_name = file_name
($url);
65 my $article_name = article_name
($file_name);
66 if(start_wget
($url)) {
67 my $title = file_title
($file_name);
68 $article_name = $title if($title);
69 if($url =~ /[^\/]+\
/([^\/]+)\
/([^\/]+)\
//) {
71 open FO
,">>","files.js";
74 open FO
,">","files.js";
75 print FO
"var files=new Array();\n";
77 print FO
"files.push([\"$1\",\"$2\",\"$article_name\",\"$file_name\"]);\n";
80 print STDERR
"$article_name ==> $file_name\n";
84 return undef,$url,"Download failed";
89 my @r = get_article
($_);
91 print STDERR
"$r[2]:$r[1]\n";
94 print STDERR
"$r[2]:$r[1]\n";
100 print STDERR
"Usage:\n\t$0 (CodeProject URLs)\n";