]> git.sesse.net Git - ccbs/blobdiff - parse/parse-ccbs-tournament.pl
Fix CCBS parsing of nicks with spaces in them.
[ccbs] / parse / parse-ccbs-tournament.pl
index 29aadf99890daa42b42edde5f30a91b66d2ec122..e5ed36bb2bf27c9484cbd3a026478cf80e245cd6 100644 (file)
@@ -55,7 +55,7 @@ while (<>) {
        }
 
        # Player rankings
-       if (/^ \s* <li> ( \d+) \. \s* place: \s* <a.*?> ( \S+ ) (?: \s* \( ( [A-Z]+ ) \) )? <\/a> , \s* with \s* ( \d+ ) \s* points/x) {
+       if (/^ \s* <li> ( \d+) \. \s* place: \s* <a.*?> ( .*? ) (?: \s* \( ( [A-Z]+ ) \) )? <\/a> , \s* with \s* ( \d+ ) \s* points/x) {
                my ($ranking, $nick, $code, $points) = ($1, $2, $3, $4);
 
                # Woot, evil
@@ -128,7 +128,7 @@ while (<>) {
        }
        
        # Player's results (header)
-       if (/^\s* <a \s* href="\S+"> (\S+) (?: \s* \( ( [A-Z]+ ) \) )? <\/a> \s*$/x) {
+       if (/^\s* <a \s* href=" .*? \/player\.pl \? id=\d+"> (.*?) (?: \s* \( ( [A-Z]+ ) \) )? <\/a> \s*$/x) {
                $player = $1;
 
                printf "INSERT INTO roundparticipation (tournament, round, parallel, player, position) VALUES (\n";