This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
############################################################################### | |
# # | |
# Maschinendeck Unsplash wrapper # | |
# # | |
############################################################################### | |
/** | |
* This script provides a replacement for the old | |
* `https://source.unsplash.com/random` endpoint, which is no longer available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php declare(strict_types=1); | |
function msg(string $message) : void { | |
echo "$message\n"; | |
} | |
function error(string $message, int $code = 1) : void { | |
msg("[ERROR] $message"); | |
exit($code); |