This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Why don`t works?!

Help for those learning Tcl or writing their own scripts.
Post Reply
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Why don`t works?!

Post by FcLan »

Code: Select all

package require http

bind msg - !test test_check
proc test_check {nick host hand chan text} {
set url "http://www.sensiblesoccer.de/index.php?lng=en"
set counter 0
set limit "4"
catch { set connection [http::geturl $url -timeout 3000] } error
if {[string match -nocase "*::http::*" $error]} {
set source [http::data $connection];http::cleanup $connection
set source [string map -nocase {"</item>" "|"} $source]
foreach line [split $source |] {
if {[regexp {^.*?<td class="medium"><b class="marker">(.*?)</tr>.*?$} $line tmp lines ]} {
regexp {^.*?<td class="medium"><b class="marker">(.*?)</font></td>.*?$} $lines tmp titel
regexp {^.*<td class="right_rank_header" style="color:silver" bgcolor="#000022">(.*?)*?} $lines tmp link
putserv "PRIVMSG $nick :$titel"
putserv "PRIVMSG $nick :works!:D"
incr counter
}
if {$counter == $limit} {unset counter;return 0}
}
}
}

putlog "news loaded!"
This script don`t works the htm code looks:

Code: Select all

<td class="medium"><b class="marker">New Interview with Jon Hare</font></td>
</tr>
<tr height="16">
<td class="right_rank_header" style="color:silver" bgcolor="#000022">.. by autor on 02.12.2005</td>
</tr>
I want to get latest news and autor...: New Interview with Jon Hare by autor on 02.12.2005
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

check out this
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Post by FcLan »

Yes, thanks, but my code looks hardly :/
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

FcLan wrote:Yes, thanks, but my code looks hardly :/
You are expected to read and work it out for yourself. This is, after all, the Scripting Help forum and not the Script Requests forum.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply