]>
jfr.im git - irc/SurrealServices/srsv.git/blob - branches/erry-devel/auspice/chanslurp.pl
3 # This file is part of SurrealServices.
5 # SurrealServices is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # SurrealServices is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with SurrealServices; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 $dbh = DBI-
>connect("DBI:mysql:services", "services", "yQ0AaCLdMhfEBTpxwc0OWw", { AutoCommit
=> 1, RaiseError
=> 1 });
31 $register = $dbh->prepare("INSERT IGNORE INTO chanreg SET chan=?, descrip=?, founder=?, pass=?, regd=?, last=?, topic=?, topicer='unknown', topicd=?, successor=?, bot=?");
32 $create_acc = $dbh->prepare("INSERT IGNORE INTO chanacc SET chan=?, nick=?, level=?, adder=?");
38 # 0name;1founder;2pass;3time_registered;4url;email;5mlock_key;6welcome;7hold;8mark;9freeze;10forbid;11successor;12mlock_link;13mlock_flood;14bot;15markreason;16freezereason;17holdreason;18lastgetpass;19access-level:nick:adder;20last_topic\ndesc
40 while(@in = split(/;/, <FILE
>)) {
41 die("Too many fields in $in[0]") if @in > 21;
42 $topic = <FILE
>; chomp $topic;
43 $desc = <FILE
>; chomp $desc;
44 @data = ($in[0], $desc, $in[1], $in[2], $in[3], $time, $topic, $time, $in[12], $in[15]);
45 print join(', ', @data), "\n";
46 $register->execute(@data);
47 $create_acc->execute($in[0], $in[1], 7, '');
49 foreach $acc (split(/,/, $in[20])) {
50 @d = split(/:/, $acc);
54 print "acc: ", join(', ', @d), "\n";
55 $create_acc->execute($in[0], $d[1], $d[0], $d[2]);