summaryrefslogtreecommitdiffstats
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
commiteca065388a32268de0c821f251effdf9ed638aec (patch)
treedf629c4776ae26451b754e6ac50cacfc7dbac0cd
parentca5b4821cdfc7d093f683ba7781b33c983f36bd6 (diff)
downloadpttbbs-eca065388a32268de0c821f251effdf9ed638aec.tar
pttbbs-eca065388a32268de0c821f251effdf9ed638aec.tar.gz
pttbbs-eca065388a32268de0c821f251effdf9ed638aec.tar.bz2
pttbbs-eca065388a32268de0c821f251effdf9ed638aec.tar.lz
pttbbs-eca065388a32268de0c821f251effdf9ed638aec.tar.xz
pttbbs-eca065388a32268de0c821f251effdf9ed638aec.tar.zst
pttbbs-eca065388a32268de0c821f251effdf9ed638aec.zip
*** empty log message ***
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk@474 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--pttbbs/util/udnnews.pl18
1 files changed, 10 insertions, 8 deletions
diff --git a/pttbbs/util/udnnews.pl b/pttbbs/util/udnnews.pl
index f198d273..d953c388 100644
--- a/pttbbs/util/udnnews.pl
+++ b/pttbbs/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;
}