<?php
/**
 * Wetter-API: Antwort gecacht (Standard 30 Min).
 * Aufruf: api_wetter.php?plz=97478 oder api_wetter.php?plz=Knetzgau
 */
require __DIR__ . '/../config.php';
require FUNCTIONS_ROOT . '/functions_db.php';
require FUNCTIONS_ROOT . '/functions_wecker.php';
require FUNCTIONS_ROOT . '/functions_common.php';
require FUNCTIONS_ROOT . '/functions_wetter.php';

header('Content-Type: application/json; charset=utf-8');

$plz = isset($_GET['plz']) ? trim((string) $_GET['plz']) : '';
$result = function_wetter_fetch($plz);
echo json_encode($result);
