Subversion リポジトリの参照
Contents of /bathyscaphe/tags/start/application/subproj/BWAgent/rosetta.pl
Parent Directory
| Revision Log
Revision 46 -
( show annotations)
( download)
( as text)
Sun May 22 04:12:35 2005 UTC
(19 years ago)
by (unknown author)
File MIME type: text/x-perl
File size: 771 byte(s)
This commit was manufactured by cvs2svn to create tag 'start'.
1 |
#!/usr/bin/perl |
2 |
|
3 |
#rosseta.pl - ユーザ定義リストの更新 |
4 |
#tsawada2 memo: |
5 |
#ARGV[0] is downloaded html file fullpath |
6 |
#ARGV[1] is board.plist's fullpath |
7 |
|
8 |
for(split ">", curl("$ARGV[0]")){ |
9 |
if(m#HREF=http://(.+?)\.2ch\.net/(.+?)/#){$table{$2}=$1; } |
10 |
} |
11 |
treat("$ARGV[1]"); |
12 |
sub treat{ |
13 |
my $plist=shift;$plist=~s/~/$ENV{HOME}/; |
14 |
open(IN,"$plist");undef $/;my $content=<IN>;close(IN); |
15 |
$content=~s#http://(.*?)\.2ch\.net/(.+?)/#bosh($1,$2)#eg; |
16 |
open(OUT,">$plist");print OUT $content;close(OUT); |
17 |
} |
18 |
|
19 |
sub bosh{ |
20 |
my ($oserv,$name)=@_; |
21 |
my $serv=$table{$name}; |
22 |
if($serv eq "") {$serv=$oserv;} |
23 |
unless($oserv eq $serv){print "$name moved: $oserv --> $serv\n";} |
24 |
return "http://$serv.2ch.net/$name/"; |
25 |
} |
26 |
|
27 |
sub curl { |
28 |
my $a=shift; |
29 |
open(IN,"$a");undef $/;my $content=<IN>;close(IN); |
30 |
return $content; |
31 |
} |
|