Code: Select all
# egghttp_example.tcl
# Config
set url "http://www............com/test.html"
set dcctrigger "example"
# End of config
if {![info exists egghttp(version)]} {
putlog "egghttp.tcl was NOT successfully loaded."
putlog "egghttp_example.tcl has not been loaded as a result."
} else {
proc your_callbackproc {sock} {
global url
set headers [egghttp:headers $sock]
set body [egghttp:data $sock]
regsub -all "\n" $body "" body
regsub -all -nocase {<br>} $body "<br>\n" body
regexp {We have served <b>(.*)</b> people to date!} $body - served
putlog "Website '$url' has served $served people so far."
}
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 "egghttp_example.tcl has been successfully loaded."
}
"And this is the content of the website
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<Welcome to my Site<br>
<table width="394" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="394" height="62" valign="top"><p>0.No spamming. This includes unauthorized
scripts and bots and excessive use of colors. (Bold Font or Contstant
Caps included)<br>
1.No vulgar, racist, or offensive language. This includes but is not limited
to swearing and harrassment. <br>
2.All communication should be in the English language. </p>
<br>We have served <b>710</b> people to date!<br>
<br>
</center> </BODY></HTML>
when .example is executed in the dcc line i get the last line."Website 'http://www.........com/test.html' has served 710 people so far."
my Q is how do i get the full content starting from "Welcome to My site....
ie wat eva there is in the page it is extracted.
i have searched thru forums ..but most of them are complicated, so please ..may be u can help.. Thanks in Advance