Diff for /db/prgsrc/chronicles.pl between versions 1.4 and 1.5

version 1.4, 2003/03/17 15:49:27 version 1.5, 2010/08/14 00:07:02
Line 30  Boris Veytsman Line 30  Boris Veytsman
     use strict;      use strict;
 use DBI;  use DBI;
   
   
 # Creating hash dbtochronicles;  # Creating hash dbtochronicles;
 my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "")  my($dbh) = DBI->connect("DBI:mysql:chgk", "piataev", "")
     or die "Can't connect to DB chgk\n";      or die "Can't connect to DB chgk\n";
 my %dbtochronicles;  my %dbtochronicles;
 my $sth=$dbh->prepare("SELECT FileName,URL from Tournaments where Type='þ'   my $sth=$dbh->prepare("SELECT FileName,URL from Tournaments where 
 and not isnull(URL)");   not isnull(URL) and Filename like '%.txt'");
 $sth->execute;  $sth->execute;
 while (my ($name,$url) = $sth->fetchrow_array) {  while (my ($name,$url) = $sth->fetchrow_array) {
     $dbtochronicles{$name}=$url;      $dbtochronicles{$name}=$url;
Line 54  while (my $file=readdir(DIR)) { Line 53  while (my $file=readdir(DIR)) {
         open (FILE, $file);          open (FILE, $file);
         while (<FILE>) {          while (<FILE>) {
             chomp;              chomp;
             if (/znatoki\/cgi-bin\/db.cgi\?tour=([^\"]*)\"/) {              if (/http:\/\/db.chgk.info\/cgi-bin\/db.cgi\?tour=([^\"]*)\"/) {
                 my $name="$1.txt";                  my $name="$1.txt";
                 if (!exists($dbtochronicles{$name}) ||                  if (!exists($dbtochronicles{$name}) ||
                     $dbtochronicles{$name} !~ /$file$/) {                      $dbtochronicles{$name} !~ /$file$/) {

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>