\n"; while (true) { echo "http://c64.ch/demos/realdetail.php?id=".$x.""; $query = trim(get_data("http://c64.ch/demos/realdetail.php?id=".$x)); // If the page redirects to the main page, the game with that ID doesn't exist if (strpos($query, "C64.CH - The C64 Demo Portal - News") !== FALSE) { break; } preg_match("/(.*?) by (.*?)<\/a>/", $query, $gametitle); $gameauthor = trim($gametitle[2]); $gametitle = trim(str_replace(array(' (', ')'), array(', ', ''), $gametitle[1])); $info = array(); $info[] = $gametitle; preg_match("/\/demos\/list\.php\?year=(.*?)&source=year/", $query, $year); $year = $year[1]; if ($year !== NULL) { $info[] = $year; } preg_match("/\/demos\/list\.php\?source=party&partyid=.*?\">(.*?)<\/a>/", $query, $party); $party = trim(str_replace(array(' (', ')'), array(', ', ''), $party[1])); if ($party !== NULL) { $info[] = $party; } $gametitle = $gameauthor." (".implode(") (", $info).").zip"; $found[] = array($gametitle, "http://c64.ch/demos/download.php?id=".$x); echo "Found new: 1, old: 0\n"; $x++; } echo "\n"; if (sizeof($found) > 0) { echo "

New files:

"; } foreach ($found as $row) { echo "".$row[0]."
\n"; } echo "
\n"; ?>