![]() |
|
|||||||
| Tcl scripting Tcl scripting related questions |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Sep 2006
Age: 36
Posts: 7
Rep Power: 0 ![]() |
La urmatorul script da eroarea: Tcl error [stiri]: can't read "news": no such variable
Code:
set max "6"
set chan "#pascani"
set url "http://www.newspascani.ro/modules/news/index.php"
set msg "Ultimele 5 stiri:"
bind pub - !stiri stiri
package require http;
proc stiri {nick host hand chan text} {
global url max
set tectoken [::http::geturl "$url"];
set tecdata [tec_html [::http::data $tectoken]]
http::cleanup $tectoken
set max $max
set num 0
foreach tmp [split $tecdata \n] {
if {[regexp {^.*<p class="itemText">(.*)</p>} $tmp tmp datum]} {
set news $datum
}
if {[regexp {^.*<span class="itemPermaLink"><a href="(.*)">} $tmp tmp url]} {
set url $url
}
if {$num < $max} {
puthelp "PRIVMSG $nick :$news"
puthelp "PRIVMSG $nick :$url"
incr num
}
}
}
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script de genul !stiri | GoRaPiD | Tcl scripting | 1 | 12-02-2007 22:06 |