X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2FinsertDB.pl;h=1206414f4fb904726e52586357fbb8310e09bf8f;hb=45e51047c2df703229843193e49fb9829489170f;hp=557fddb922f1dbb6797f8e5116ba0c64ecdc0c11;hpb=bb482ed34735d13cad2a02cf0f5cdc322b6b9f89;p=infobot.git diff --git a/scripts/insertDB.pl b/scripts/insertDB.pl old mode 100644 new mode 100755 index 557fddb..1206414 --- a/scripts/insertDB.pl +++ b/scripts/insertDB.pl @@ -9,7 +9,7 @@ require "src/logger.pl"; require "src/modules.pl"; require "src/Factoids/DBCommon.pl"; -&loadConfig($infobot_misc_dir."/infobot.config"); +&loadConfig( $bot_config_dir . "/infobot.config" ); &loadDBModules(); unless (@_) { @@ -18,19 +18,21 @@ unless (@_) { } foreach (@_) { - next unless ( -f $_); + next unless ( -f $_ ); - open(IN, $_) or die "error: cannot open $_\n"; + open( IN, $_ ) or die "error: cannot open $_\n"; print "Opened $_ for input...\n"; print "inserting... "; while () { - next unless (/^(.*?) => (.*)$/); + next unless (/^(.*?) => (.*)$/); - ### TODO: check if it already exists. if so, don't add. - &setFactInfo($1, "factoid_value", $2); - print ":: $1 "; + ### TODO: check if it already exists. if so, don't add. + &setFactInfo( $1, "factoid_value", $2 ); + print ":: $1 "; } close IN; } + +# vim:ts=4:sw=4:expandtab:tw=80