|
- <?php
- /*
- * Outputs metadata of the sender
- * Copyright (C) 2020 Polyna <https://wandystan.eu/B196>
- *
- * This file is part of LDMW statistical scripts.
- *
- * LDMW statistical scripts are free software: you can redistribute them
- * and/or modify them under the terms of the GNU Affero General Public
- * License as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *
- * LDMW statistical scripts are distributed in the hope that they will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with LDMW statistical scripts. If not, see
- * <https://www.gnu.org/licenses/>.
- */
- require_once 'common.php';
-
- $hash = $_GET['hash'];
- if (! mb_ereg_match('^[0-9a-f]{8}$', $hash))
- exit_error('Invalid hash.');
-
- header('Content-type: application/ld+json');
- print json_encode([
- '@context' => 'https://wandystan.eu/statistics/context.jsonld',
- '@id' => 'sender/' . $hash,
- '@type' => 'Agent',
- 'name_fnv1a32sum' => $hash
- ]);
|