| View previous topic :: View next topic |
| Author |
Message |
tersayang Voice
Joined: 18 Apr 2007 Posts: 3
|
Posted: Wed Apr 18, 2007 7:24 am Post subject: character limit |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Apr 18, 2007 7:31 am Post subject: |
|
|
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 |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Apr 19, 2007 12:19 am Post subject: |
|
|
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 |
|
 |
|