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.

egghttp again

Old posts that have not been replied to for several years.
Locked
g
ghosted
Voice
Posts: 1
Joined: Fri Jul 08, 2005 12:36 pm

egghttp again

Post by ghosted »

i tried modifying green's tv tcl for another website for !today, !tommorrow, but i can't seem to get any data when i call it from dcc


# Config
set url "http://www.thefutoncritic.com/cgi/calen ... w=whatsnew"
set dcctrigger "example"
# End of config

if {![info exists egghttp(version)]} {
putlog "egghttp.tcl was NOT successfully loaded."
putlog "example.tcl has not been loaded as a result."
} else {
proc your_callbackproc {sock} {
global url
set headers [egghttp:headers $sock]
set data [egghttp:data $sock]

set data [string map {"\n" ""} $data]
set data [string map {"</tr>" "</tr>\n"} $data]
set data [string map {"</div>" "</div>\n"} $data]
set data [string map {"</td>" "</td>~"} $data]
set data [string map {"f-normal\">" "f-normal\">~"} $data]

set parse 0
foreach line [split $data \n] {
if [string match -noc "*<span class='bigorange'>*" $line] {set parse 1}
if {$parse&&[string match -noc *<span class='bigorange'>7/8/2005 (friday)</span>* $line]} {return}

if {$parse} {

regsub -all {<(.|\n)*?>} $line {} clean
set out [join $clean]
putlog "$out"
}
}
}

bind dcc o|o $dcctrigger our:dcctrigger
proc our:dcctrigger {hand idx text} {
global url
set sock [egghttp:geturl $url your_callbackproc]
return 1
}

putlog "example.tcl has been successfully loaded."
}
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

I posted it here.
Locked