Last active
December 16, 2019 15:57
-
-
Save companje/83939d9f1f22335ab77a3455e3c888d9 to your computer and use it in GitHub Desktop.
beeldbank-redirect.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usage: ?guid=E3951481AF0A54C18999B79BE2449EC1 of via .htaccess | |
<?php | |
$apiKey = "b29fb3e4-5302-11e6-8975-2b551e9b96f4"; | |
$guid = strtolower($_GET["guid"]); | |
if (strlen($guid)!=32) die("404"); | |
$a = substr($guid,0,8); | |
$b = substr($guid,8,4); | |
$c = substr($guid,12,4); | |
$d = substr($guid,16,4); | |
$e = substr($guid,20,12); | |
$guid="$a-$b-$c-$d-$e"; | |
$url = "https://webservices.picturae.com/mediabank/media/$guid?apiKey=$apiKey"; | |
$json = file_get_contents($url); | |
$json = json_decode($json); | |
header("Location: ".$json->media[0]->asset[0]->thumb->large); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment