From 16c3a9991961588f43d6d280cc93317d29d242dc Mon Sep 17 00:00:00 2001 From: in2 Date: Tue, 16 Dec 2003 03:05:49 +0000 Subject: use Compress::Zlib to save disk space git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@1413 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- staticweb/man.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'staticweb/man.pl') diff --git a/staticweb/man.pl b/staticweb/man.pl index 4e9c2ed3..6afb7410 100755 --- a/staticweb/man.pl +++ b/staticweb/man.pl @@ -12,6 +12,7 @@ use Data::Serializer; use Time::HiRes qw/gettimeofday tv_interval/; use b2g; use POSIX; +use Compress::Zlib; use vars qw/%db $brdname $fpath $isgb %b2g/; @@ -88,7 +89,12 @@ sub articlemode { my(%th); $th{tmpl} = 'article.html'; + + # ㄓ unzip, 璶ぃ礛穦年奔 :p $th{content} = $db{$fpath}; + $th{content} = Compress::Zlib::memGunzip($th{content}) + if( $db{_gzip} ); + $th{content} =~ s/\033\[.*?m//g; $th{content} =~ s|(http://[\w\-\.\:\/\,@\?=~]+)|$1|gs; @@ -98,9 +104,9 @@ sub articlemode $th{content} =~ s|祇獺: у金金龟穨|祇獺: у金金龟穨|gs; $th{content} =~ - s|ptt\.csie\.ntu\.edu\.tw|ptt.csie.ntu.edu.tw|gs; + s|ptt\.cc|ptt.cc|gs; $th{content} =~ - s|ptt\.twbbs\.org|ptt.twbbs.org|gs; + s|ptt\.twbbs\.org|ptt.twbbs.org|gs; $th{content} =~ s/([\xA1-\xF9].)/$b2g{$1}/eg if( $isgb ); #Encode::from_to($th{content}, 'big5', 'gbk') if( $isgb ); -- cgit v1.2.3