5
1
Fork 0
mirror of https://github.com/Anvilcraft/jensmemes synced 2024-11-25 18:12:33 +01:00
jensmemes/website/random.php

12 lines
369 B
PHP

<?php
$json = file_get_contents("https://jensmemes.tilera.xyz/api.php/random");
$obj = json_decode($json, false, 512, JSON_UNESCAPED_UNICODE);
$file = $obj->link;
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
if ($ext == "mp4") {
echo "<a href='$file'><video src='$file' controls ></video></a>";
} else {
echo "<a href='$file'><img src='$file' /></a>";
}
?>