botlending forum  

Go Back   botlending forum > Eggdrop & TCL > Tcl scripting

Tcl scripting Tcl scripting related questions

Reply
 
LinkBack Thread Tools Display Modes
Old 06-07-2007, 11:10   #1 (permalink)
Junior Member
 
Join Date: Sep 2006
Age: 36
Posts: 7
Rep Power: 0
vlad2006 is an unknown quantity at this point
Default Stiri

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
                }
        }
    }
Pliz daca imi puteti zice ce am gresit :-?
vlad2006 is offline   Reply With Quote
Old 06-07-2007, 16:49   #2 (permalink)
Member
 
Join Date: Jun 2004
Location: Canada
Age: 18
Posts: 141
Rep Power: 0
AdrianK is on a distinguished road
Default

greshala in

Code:
if {[regexp {^.*<p class="itemText">(.*)</p>} $tmp tmp datum]} {
        set news $datum
        }
AdrianK is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Script de genul !stiri GoRaPiD Tcl scripting 1 12-02-2007 22:06


All times are GMT +3. The time now is 13:17.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.