1
0
Fork 0
randomograf/randomograf.php
2023-06-14 19:55:21 +02:00

35 lines
996 B
PHP

<?php
/* Randomograf */
if(fnmatch("http.rb/* (Mastodon*", $_SERVER['HTTP_USER_AGENT'])) {
$a = array("Laks", "Faxmaskiner", "Syltekrukke", "Ladestander", "Nøgenbilist", "Bøfsandwich", "Fiskefingre", "Topnøgle");
$b = array("spiser", "jonglerer", "dikterer", "forbløffer", "serverer");
$c = array("af", "for", "på grund af", "efter", "med");
$title = $a[rand(0,7)] . " " . $b[rand(0,4)] . " " . $a[rand(0,7)] . " " . $c[rand(0,4)] . " " . $a[rand(0,7)];
?>
<html>
<head>
<title><?=$title?></title>
<meta property="og:image" content="data/<?=sprintf("%03d.jpg", rand(1,23))?>" />
<meta property="og:title" content="<?=$title?>" />
<meta property="og:description" content="Din fake Mastodon preview generator. Nu til halv pris." />
</head>
<body>
<h1>Hej Mastodon!</h1>
</body>
</html>
<?php
} else {
?>
<html>
<head>
<title>Randomograf</title>
</head>
<body>
<h1>Tillykke du er ikke Mastodon!</h1>
<p>Så er der ik' så meget mere, hej hej! o/</p>
</body>
</html>
<?php
}
?>