updated git and svn scripts
[xrzperl.git] / sinabook_batchget
blobdf183cbc3b1dd65f3d2afc94f7e03bc66fa00c0a
1 #!/usr/bin/perl -w
2 ###APPNAME: sinabook_batchget
3 ###APPAUTHOR: xiaoranzzz
4 ###APPDATE: Wed Mar 12 04:10:17 2008
5 ###APPVER: 0.1
6 ###APPDESC: batch download books from book.sina.com.cn
7 ###APPUSAGE: URL [CMD]
8 ###APPEXAMPLE: sinabook_batchget http://club.book.sina.com.cn/booksearch/booksearch.php?area=author&kw=%BC%D6%C6%BD%B0%BC sinabook_justtext
9 ###APPOPTION:
10 use strict;
11 $ARGV[0]="-h" unless(@ARGV);
12 foreach(@ARGV){
13 exit(system("plhelp",$0,@ARGV)) if($_ eq "-h" || $_ eq "--help");
15 my $URL=shift;
16 my $CMD=shift;
17 $CMD="sinabook_justtext" unless($CMD);
19 open FI,"-|","urlrule -P -H '$URL'";
20 while(<FI>) {
21 chomp;
22 system($CMD,$_);
24 close FI;