Changeset 4126 for websites/AjaxCom

Show
Ignore:
Timestamp:
01/07/08 00:03:24 (5 years ago)
Author:
kawa0117
Message:

snip on too long comment (2007-12-27)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/AjaxCom/com/cgi-lib/ajaxcom-main.pl

    r4123 r4126  
    7777        my( $pubdate, $pid, $ip, $name, $content ) = split( /\t/, $pair->[1] ); 
    7878        chomp $content; 
     79 
     80{ 
     81  use Encode; 
     82  my $MAX_CHAR = 140; 
     83  $content = decode_utf8( $content ); 
     84  if ( length($content) > $MAX_CHAR ) { 
     85    substr( $content, $MAX_CHAR ) = "..."; 
     86  } 
     87  $content = encode_utf8( $content ); 
     88} 
     89 
    7990        my $url = "$URL_ROOT/$path#com-$pubdate"; 
    8091        my $item = $feed->add_item( $url );