Example:
www.test.com/test.html looks like this:
# How to output the string? (It has to be $startstring)<html>
<body>
<h1>Animal Dog</h1>
</body>
</html>
When I use $text, it doesnt work!
My Starting:
Code: Select all
package require http
bind pub - !searchstring searchproc
proc searchproc {nick uhost hand chan text} {
set url "www.test.com/test.html"
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
regexp {<h1>$startstring(.*?)</h1>.*?} $fullcontent $stringcontent
if {[info exists $startstring]} {putserv "PRIVMSG $chan : String not found"}
else {putserv "PRIVMSG $chan : $stringcontent} }
How can I do that?