diff --git a/wizzardRedux/admin/onlinecheck.php b/wizzardRedux/admin/onlinecheck.php index e772a29..4c3321b 100644 --- a/wizzardRedux/admin/onlinecheck.php +++ b/wizzardRedux/admin/onlinecheck.php @@ -12,6 +12,7 @@ Notes: - AtariOnline No idea what "compare" block does - c64gamescom Empty checker page - C64Heaven No idea how to get to the archive, only few files on home page + - C64Warez Needs registration; possible cookie usage - CPC-Power "full" is no longer active - Import64 Empty checker page - NES-CartDatabase Needs more testing @@ -25,11 +26,10 @@ Notes: - Vizzed Possible cookie usage TODO: Retool existing onlinecheck.php files to follow the new format. 3) check code flow to try to optimize -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 - C64Tapes +TODO: Last updated - C64Warez ------------------------------------------------------------------------------------ */ ini_set('max_execution_time', 0); // Set the execution time to infinite. This is a bad idea in production. diff --git a/wizzardRedux/sites/C64Warez.php b/wizzardRedux/sites/C64Warez.php index 843c5f6..af111c2 100644 --- a/wizzardRedux/sites/C64Warez.php +++ b/wizzardRedux/sites/C64Warez.php @@ -2,75 +2,78 @@ // Original code: The Wizard of DATz -// TODO: This site needs an overhaul. The URL and page structure changed and now requires a login to download the files. +// TODO: Find what the download URL is (currently old one being used) -print "
";
+$pages = get_data("http://remotecpu.com/downloads.html");
+preg_match_all("/'?(\/downloads\/category\/.*?)'?,/", $pages, $pages);
+$pages = $pages[1];
 
-//$query = get_data('http://c64warez.com/');
-$query = get_data('http://remotecpu.com/downloads.html');
-preg_match_all('/', $query, $categories);
-var_dump($categories);
-$query = explode('\n";
+foreach ($pages as $page)
 {
-	$row = explode('"', $row);
-	$row = $row[0];
-
-	$parts = explode('/', $row);
-
-	if ($parts[0] != 'get_file')
+	echo "".$dir."";
+	
+	$query = get_data("http://remotecpu.com/downloads".$page);
+	//$query = get_data("http://remotecpu.com/downloads/category/236-strategy-games.html");
+	
+	preg_match("/Category: (.*?)<\/b>/", $query, $category);
+	$category = $category[1];
+	
+	preg_match_all("//", $query, $links);
+	$links = $links[1];
+	
+	if (sizeof($links) == 0)
 	{
-		print "load ".$row."\n";
-
-		$queryb = get_data('http://c64warez.com/files/'.str_replace(' ', '%20', $row));
-		$queryb = explode('System<\/td>(.*?)<\/strong><\/tr>/", $gamepage, $system);
+		$system = trim($system[1]);
+		
+		preg_match("/.*?.*?(.*?)<\/span><\/td>/s", $gamepage, $name);
+		$name = trim($name[1]);
+		
+		$title = "{".$system."}".$name." (".$category.")";
+		
+		$id = explode("/", $link);
+		$id = $id[sizeof($id) - 1];
+		$id = explode("-", $id);
+		$id = $id[0];
+		
+		if (!$r_query[$id])
+		{
+			// This link is outdated, but without registration it's impossible to get the updated link
+			$found[] = array($title, "http://c64warez.com/files/get_file/".$id);
+			$new++;
+			$r_query[$id] = true;
+		}
+		else
+		{
+			$old++;
+		}
+	}
+
+	echo "Found new: ".$new.", old: ".$old."\n";
 }
+echo "\n";
 
-print "\nnew urls:\n\n";
-print "
";
-
-foreach ($found as $url)
+if (sizeof($found) > 0)
 {
-	print $url[1]."\n";
+	echo "

New files:

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