| View previous topic :: View next topic |
| Author |
Message |
leandro Voice
Joined: 02 Jun 2007 Posts: 13
|
Posted: Tue Oct 30, 2007 12:50 pm Post subject: The best way to do this? |
|
|
Hi.
I'm creating an online database of akicks from a channel. Akicks can be added to the database via a webserver.
I display the newly added akicks on a webpage, which then the eggdrop must read, add them in chanserv, and mark them on the webserver.
But what is the best way to do this? Should I save the whole webpage to a .txt, then loop through the file, opening and closing a connection for each akick that needs to be set? Or should I do something else?
Thanks for your help. |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
leandro Voice
Joined: 02 Jun 2007 Posts: 13
|
Posted: Tue Oct 30, 2007 1:02 pm Post subject: |
|
|
Yes, MySQL.
Can you explain me how to do this in a more detailled manner? |
|
| Back to top |
|
 |
r0t3n Owner
Joined: 31 May 2005 Posts: 507 Location: UK
|
Posted: Tue Oct 30, 2007 3:43 pm Post subject: |
|
|
Lets say you have a mysql database named akicks, with the fields mask, set.
| Code: | bind time - "?0 * * * *" akick:update
proc akick:update {min hour day month year} {
if {[catch {[set mysql [mysql::connect -user username -password mypassword -host localhost -port 3306 -db akicks]} err]} {
putlog "mysql error"
foreach line [split $err \n] { putlog "$line" }
putlog "end of error"
} else {
set result [mysql::sel $mysql "SELECT * FROM `akicks` WHERE `set` = '0';" -list]
if {$result == ""} { return }
foreach akick $result {
if {$akick == ""} { return }
set mask [lindex [split $akick] 0]
putlog "adding '$mask' to akick list for #mychannel"
putquick "PRIVMSG ChanServ :akick #mychannel add $mask"
mysql::exec $mysql "UPDATE `akicks` SET `set` TO '1' WHERE `mask` = '$mask';"
}
putlog "updated akicks"
}
} |
This is just an example, not guaranteed working![/code] _________________ r0t3n @ #r0t3n @ Quakenet |
|
| Back to top |
|
 |
leandro Voice
Joined: 02 Jun 2007 Posts: 13
|
Posted: Tue Oct 30, 2007 3:45 pm Post subject: |
|
|
Thank you very much!
I'll look into that! |
|
| Back to top |
|
 |
|