I need a script, which should do this:
When somebody in a channel types "!test", I want that my eggdrop automaticly posts a text/string. This text/string comes from a php or html file (http://www.site.com/thefile.html), i specified.
The Problem is, that the html source code contains much text, and I dont know how to tell the eggdrop, to post just the text/string I want.
By searching I found this example code:
Code: Select all
bind pub - !example my:example
proc my:example {nick uhost hand chan text} {
set url "http://your.web.server/page.php"
set token [::http::geturl $url]
set content [::http::data $token]
::http::cleanup $content
foreach line [split $content \n] {
putserv "PRIVMSG $chan :$line"
}
}
Example:
This is a part of the html source code, and I want the eggdrop to post the red marked text on my channel when somebody types !test.<html>
...code...
<tr><td bgcolor="#ffffff"><b>Here is any text</b><br>I want this</td><td bgcolor="#ffffff" align="right" valign="top">text...<b>text</b><br>more text and so on<b>text</b></td></tr>
...code...
Thanks for helping!
p.s.
Here another good example:
http://uhrzeit.org/atomuhr.html
(uhrzeit is german and means "Time"; uhr = a clock)
When somebody types !time, I want that the time is posted on the channel.
The source code from the website:
Code: Select all
...code...
<h6 id="anzeige" class="off" style="padding-left:15px;padding-right:15px;">
13:39:53</h6><br>
<br>
Die Uhrzeit wird in regelmässigen Abständen mit.....code.....
EDIT:
I tried the script from demond (which needs tDOC), and it works. But it only works in my shell at home:) not with the eggdrop