egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

character limit

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
tersayang
Voice


Joined: 18 Apr 2007
Posts: 3

PostPosted: Wed Apr 18, 2007 7:24 am    Post subject: character limit Reply with quote

Can someone help me with my code, 1st this code is get a head line from news website and than parsing to channel. the codes is bellow
regexp -nocase {<font class="tgl">(.+?)</font><br>} $html - rtanggal
regexp -nocase {<a href=\"(.+?)\" class="judul">(.+?)</a><br>} $html - rurl rjudul
regexp -nocase {<font class="deskripsi">(.+?)</font><br>} $html - risi


if {![info exists risi]} {
putlog "\[NEWS\] Republika ErroR!!"
return 0
}

set rurl1 "http://www.republika.co.id/${rurl}"

set output " \[Republika\]4,2 ${rtanggal}8,2 ${judul}0,2 ${risi}11,2 ${rurl1}"

foreach ruang $channels {
putserv "PRIVMSG $ruang :$output"
}
return 0
}

My question is how to limit the ${isi} into 50 characters only ?

thanks
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Apr 18, 2007 7:31 am    Post subject: Reply with quote

I'd suggest you have a look at the 'string' command, or more speciffically, 'string range'. Manpages should be available on your system, otherwize look here for documentation.

Also, it's considdered good practise to put your code within "code-blocks" when posting here.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Apr 19, 2007 12:19 am    Post subject: Reply with quote

You might also want to look at the word wrap proc created by 'user' instead of cutting off headlines at arbitrary spots.

http://forum.egghelp.org/viewtopic.php?t=6690#33031

Search the forum for 'wordwrap' to find other discussion/variations of the same basic proc.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber