1
0
Fork 0
randomograf/randomograf.php

35 lines
996 B
PHP
Raw Permalink Normal View History

2023-06-14 17:55:21 +00:00
<?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> er der ik' meget mere, hej hej! o/</p>
</body>
</html>
<?php
}
?>