From fcada9bee6e230fa1973a50fcbdc28a083e2ef52 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 13 Mar 2016 09:41:30 -0700 Subject: [PATCH] Clean up c64rulez online checker --- wizzardRedux/admin/onlinecheck.php | 4 ++-- wizzardRedux/sites/c64rulez.php | 29 ++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/wizzardRedux/admin/onlinecheck.php b/wizzardRedux/admin/onlinecheck.php index 9bb972e..703b690 100644 --- a/wizzardRedux/admin/onlinecheck.php +++ b/wizzardRedux/admin/onlinecheck.php @@ -29,7 +29,7 @@ TODO: Document all required GET and POST vars for each page TODO: VideopacNL uses a cookie to be able to access the board. This means you need to log in to the site and then copy the cookie as a param TODO: Can we run all online checks in a coherent way (in series, that is)? TODO: Once all checkers are certainly using the new table and found format, standardize $found and move to this file -TODO: Last updated - C64intros +TODO: Last updated - c64rulez ------------------------------------------------------------------------------------ */ ini_set('max_execution_time', 0); // Set the execution time to infinite. This is a bad idea in production. @@ -50,8 +50,8 @@ $dead = array( "8BitCommodoreItalia", "AcornPreservation", "Atarimania", - "Cas2Rom", "c64gamescom", + "Cas2Rom", "Import64", "Konamito", "m3Zz", diff --git a/wizzardRedux/sites/c64rulez.php b/wizzardRedux/sites/c64rulez.php index eb494ea..a49d633 100644 --- a/wizzardRedux/sites/c64rulez.php +++ b/wizzardRedux/sites/c64rulez.php @@ -2,8 +2,6 @@ // Original code: The Wizard of DATz -print "
";
-
 $newfiles = array (
 	'http://c64.rulez.org/pub/c64.hu/NEWFILES.txt',
 	'http://c64.rulez.org/pub/c64/NEWFILES.txt',
@@ -12,14 +10,14 @@ $newfiles = array (
 	'http://c64.rulez.org/pub/c128/NEWFILES.txt',
 );
 
+echo "\n";
 foreach ($newfiles as $newfile)
 {
-	print "load ".$newfile."\n";
+	echo "";
 	$query = get_data($newfile);
- 	$query = explode("\n", $query);
- 	$dir = explode("/", $newfile);
-	$dir[count($dir) - 1] = null;
- 	$dir = implode("/", $dir);
+	
+	preg_match_all("/^(\S.*\/.*\.\S+)$/m", $query, $query);
+	$query = $query[1];
 
 	$old = 0;
 	$new = 0;
@@ -32,12 +30,25 @@ foreach ($newfiles as $newfile)
 		}
 		else
 		{
-			print "".$row."\n";
+			$found[] = array($row, $dir.$row);
 			$new++;
 		}
 	}
 
-	print "found new:".$new.", old:".$old."\n\n";
+	echo "\n";
+}
+echo "
".$newfile."Found new: ".$new.", old: ".$old."
\n"; + +if (sizeof($found) > 0) +{ + echo "

New files:

"; } +foreach ($found as $row) +{ + echo "".$row[0]."
\n"; +} + +echo "
\n"; + ?> \ No newline at end of file