summaryrefslogtreecommitdiffstats
path: root/util/udnnews.pl
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-08-17 02:24:43 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-08-17 02:24:43 +0800
commit080973599028776d184e4526c58fab5dc1cec8bd (patch)
tree3a334ea93a3561108045bf81cb1f17101f1aa05e /util/udnnews.pl
parenta0c710a801eba595f0882131b7bcf1b347414c4b (diff)
downloadpttbbs-080973599028776d184e4526c58fab5dc1cec8bd.tar
pttbbs-080973599028776d184e4526c58fab5dc1cec8bd.tar.gz
pttbbs-080973599028776d184e4526c58fab5dc1cec8bd.tar.bz2
pttbbs-080973599028776d184e4526c58fab5dc1cec8bd.tar.lz
pttbbs-080973599028776d184e4526c58fab5dc1cec8bd.tar.xz
pttbbs-080973599028776d184e4526c58fab5dc1cec8bd.tar.zst
pttbbs-080973599028776d184e4526c58fab5dc1cec8bd.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@474 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/udnnews.pl')
-rw-r--r--util/udnnews.pl18
1 files changed, 10 insertions, 8 deletions
diff --git a/util/udnnews.pl b/util/udnnews.pl
index f198d273..d953c388 100644
--- a/util/udnnews.pl
+++ b/util/udnnews.pl
@@ -20,9 +20,9 @@ chdir '/home/bbs';
getudnnewstitle(\@titles);
foreach( @titles ){
postout({brdname => 'udnnews',
- title => $_->[1],
+ title => FormatChinese($_->[1]),
owner => 'udnnews.',
- content => getudnnewscontent("http://www.udnnews.com/NEWS/TODAYNEWS/$_->[0]")});
+ content => getudnnewscontent("http://udnnews.com/NEWS/FOCUSNEWS/$_->[0]")});
}
sub getudnnewscontent($)
@@ -51,7 +51,7 @@ sub getudnnewstitle($)
{
my($ra_titles) = @_;
my($url, $title);
- open FH, "$LYNX -source http://www.udnnews.com/NEWS/TODAYNEWS/ | $GREP '<font color=\"#FF9933\">' |";
+ open FH, "$LYNX -source http://udnnews.com/NEWS/FOCUSNEWS/ | $GREP '<font color=\"#FF9933\">' |";
while( <FH> ){
($url, $title) = $_ =~ m|<font color="#FF9933">ĄD</font><a href="(.*?)"><font color="#003333">(.*?)</font></a><font color="#003333">|;
$title =~ s/<.*?>//g;
@@ -80,11 +80,13 @@ sub FormatChinese
$ret .= substr($str, $s, $count);
}
}
- $str = $ret;
- undef $ret;
- while( $str ){
- $ret .= substr($str, 0, $length)."\n";
- $str = substr($str, $length);
+ if( $length ){
+ $str = $ret;
+ undef $ret;
+ while( $str ){
+ $ret .= substr($str, 0, $length)."\n";
+ $str = substr($str, $length);
+ }
}
return $ret;
}