some time ago i wrote something similar
eggdrop part (you can add some regexps in this proc, whatever):
Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.2
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
set secret_key "blahblah"
set listen_port 1234
set listen_host 127.0.0.1
###########################################################################
bind evnt - prerehash prerehash_proc
set s_socket [socket -server socket_proc -myaddr $listen_host $listen_port]
proc prerehash_proc { type } {
global s_socket
close $s_socket
}
proc socket_proc { sock host port } {
fconfigure $sock -buffering line
fileevent $sock readable [list soc_action $sock $host $port]
}
proc hex2str { hex_value } {
binary format H* $hex_value
}
proc soc_action { chan host port } {
global secret_key
if {![eof $chan]} {
set soc_data [gets $chan]
if {$soc_data != ""} {
set separate_data [split [hex2str $soc_data] "\n"]
set sock_secret_key [lindex $separate_data 0]
set sock_nick [lindex $separate_data 1]
set sock_channels [lindex $separate_data 2]
if {$secret_key == $sock_secret_key} {
foreach inv_channel [split $sock_channels] {
putserv "INVITE $sock_nick $inv_channel"
}
} {
close $chan
}
}
} {
close $chan
}
}
putlog "www-invite.tcl ver 0.2 by tomekk loaded"
simple proc in PHP (its very simple you should write some flood protect etc in your proper PHP script)
Code: Select all
<?php
function send_to_eggy( $nick, $channels )
{
// secret key, eggdrop host/port
$secret_key = 'blahblah';
$eggy_ip = '127.0.0.1';
$eggy_port = 1234;
//////////////////////////////////////////////////////////////////////////////
$tcp_str = $secret_key . "\n" . $nick . "\n" . $channels;
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($sock, $eggy_ip, $eggy_port) or die ("can't connect to eggy!");
socket_write($sock, bin2hex($tcp_str));
socket_close($sock);
}
send_to_eggy('tomekk', '#chan1 #chan2 #chan3');
?>
when you start eggdrop with this TCL script, you should see that the eggdrop is listening on some port
[tomekk@zlom]:/# netstat -tapn | grep 1234
tcp 0 0 127.0.0.1:1234 0.0.0.0:* LISTEN 25057/eggdrop
all you have to do is to write your PHP page with some HTML forms for users,
one more thing, those scripts are based on TCP sockets,
make sure that your firewall is not blocking ports etc
try it