'bulgarian',
'ca' => 'catalan',
'da' => 'danish',
'de' => 'ngerman',
'en-ca' => 'canadian-english-insane',
'en-gb' => 'british-english-insane',
'en-us' => 'american-english-insane',
'eo' => 'esperanto',
'es' => 'spanish',
'fi' => 'finnish',
'fo' => 'faroese',
'fr' => 'french',
'gl' => 'galician-minimos',
'it' => 'italian',
'nb' => 'bokmaal',
'nl' => 'dutch',
'nn' => 'nynorsk',
'pt-br' => 'brazilian',
'pt-pt' => 'portuguese',
// 'pl' => 'polish', // too big, crashes PHP
'sv' => 'swedish',
'uk' => 'ukrainian',
];
$list = strtolower($_GET['list']);
$list_file = $dicts[$list];
$today = floor(date('U') / 24 / 60 / 60) * 24 * 60 * 60;
srand($today + crc32($list_file));
$motd = motd(!empty($list_file) ? "/usr/share/dict/$list_file" : '../words.txt', !in_array($list, ['fi', 'nb', 'nn', 'sv']));
// Plaintext
if(isset($_GET['raw'])) {
header('Content-Type: text/plain');
die($motd);
}
$motd = htmlspecialchars($motd);
if(isset($_GET['rss'])) {
header('Content-Type: application/rss+xml');
?>