--- db/prgsrc/chronicles.pl 2003/03/17 15:38:55 1.2 +++ db/prgsrc/chronicles.pl 2010/08/14 00:07:02 1.5 @@ -23,20 +23,19 @@ The database, user and password are hard Boris Veytsman -=head1 $Id: chronicles.pl,v 1.2 2003/03/17 15:38:55 boris Exp $ +=head1 $Id: chronicles.pl,v 1.5 2010/08/14 00:07:02 boris Exp $ =cut use strict; use DBI; - # Creating hash dbtochronicles; my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "") or die "Can't connect to DB chgk\n"; my %dbtochronicles; -my $sth=$dbh->prepare("SELECT FileName,URL from Tournaments where Type='þ' -and not isnull(URL)"); +my $sth=$dbh->prepare("SELECT FileName,URL from Tournaments where + not isnull(URL) and Filename like '%.txt'"); $sth->execute; while (my ($name,$url) = $sth->fetchrow_array) { $dbtochronicles{$name}=$url; @@ -54,7 +53,7 @@ while (my $file=readdir(DIR)) { open (FILE, $file); while () { chomp; - if (/znatoki\/cgi-bin\/db.cgi\?tour=([^\"]*)\"/) { + if (/http:\/\/db.chgk.info\/cgi-bin\/db.cgi\?tour=([^\"]*)\"/) { my $name="$1.txt"; if (!exists($dbtochronicles{$name}) || $dbtochronicles{$name} !~ /$file$/) { @@ -69,7 +68,9 @@ while (my $file=readdir(DIR)) { } closedir DIR; foreach my $name (keys %dbtochronicles) { - print "$name -> $dbtochronicles{$name}\n"; + if ($dbtochronicles{$name} =~ /boris/) { + print "$name -> $dbtochronicles{$name}\n"; + } } exit 0;