diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..723ef36 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/bin/cron.php b/bin/cron.php new file mode 100644 index 0000000..46de21d --- /dev/null +++ b/bin/cron.php @@ -0,0 +1,39 @@ + + !str_starts_with($mob, "id=") && + !str_contains($mob, "Old ") && + $mob != "NPC" && $mob != "Agent" && + !str_ends_with($mob, "Ghost") && + $mob != "Giant" && + $mob != "Killer Bunny" +); + +echo "Fetching image URLs...\n"; +$mobs = array_map(fn ($mob) => [ + "name" => $mob, + "image" => getImage($mob) +], $mobs); + +echo "Removing duplicates...\n"; +$mobs = array_reduce($mobs, function ($mobs, $mob) { + $urls = array_map(fn ($mob) => $mob["image"], $mobs); + if (!in_array($mob["image"], $urls)) { + $mobs[] = $mob; + } + return $mobs; +}, []); + +echo "Downloading images...\n"; +foreach ($mobs as $mob) { + $filename = downloadImage($mob["image"], $mob["name"]); + $mob["filename"] = $filename; + var_dump($mob); +} \ No newline at end of file diff --git a/core.php b/core.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/core.php @@ -0,0 +1 @@ +