5
1
Fork 0
mirror of https://github.com/Anvilcraft/jensmemes synced 2025-02-16 21:29:57 +01:00
jensmemes/website/random.php

13 lines
369 B
PHP
Raw Normal View History

2020-07-22 15:27:17 +02:00
<?php
2020-08-13 14:02:25 +02:00
$json = file_get_contents("https://jensmemes.tilera.xyz/api.php/random");
$obj = json_decode($json, false, 512, JSON_UNESCAPED_UNICODE);
$file = $obj->link;
2020-07-22 15:27:17 +02:00
$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>";
}
?>