From e0e85ccf6aa77f43323bf7a9aef0f74ce001701e Mon Sep 17 00:00:00 2001 From: in2 Date: Wed, 20 Nov 2002 02:07:51 +0000 Subject: =?UTF-8?q?s/=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD\&\#22531\;/?= =?UTF-8?q?=EF=BF=BD=EF=BF=BD=EF=BF=BD}/g;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@577 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- util/udnnews.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'util/udnnews.pl') diff --git a/util/udnnews.pl b/util/udnnews.pl index 4d37a26a..5e19ae88 100644 --- a/util/udnnews.pl +++ b/util/udnnews.pl @@ -20,11 +20,20 @@ chdir '/home/bbs'; getudnnewstitle(\@titles); foreach( @titles ){ postout({brdname => 'udnnews', - title => FormatChinese($_->[1]), + title => strreplace(FormatChinese($_->[1])), owner => 'udnnews.', content => getudnnewscontent("http://www.udn.com/NEWS/FOCUSNEWS/$_->[0]")}); } +sub strreplace +{ + my($str) = @_; + $str =~ s/¢Ì/¤Q/g; + $str =~ s/¢Î/¤Ê/g; + $str =~ s/´å¿ü\&\#22531\;/´å´}/g; + return $str; +} + sub getudnnewscontent($) { my($url) = @_; @@ -38,8 +47,7 @@ sub getudnnewscontent($) $content =~ s/\r//g; $content =~ s/\n\n\n/\n\n/g; $content =~ s/\n\n\n//g; - $content =~ s/¢Ì/¤Q/g; - $content =~ s/¢Î/¤Ê/g; + $content = strreplace($content); undef $ret; foreach( split(/\n/, $content) ){ s/ //g; -- cgit v1.2.3