From 0f52d80ca67a49258b235f5831163dd72fbd54cf Mon Sep 17 00:00:00 2001 From: Frankie B Date: Tue, 11 Jun 2024 18:02:01 +0100 Subject: Merge MVC rewrite into master (#21) * Just commit it all * Require auth * crap * Update homepage * Block AI scrapers * Update cache update script * Add dummy file * Remove unnecessary lastfm config var * Use withQueryParameters for LastFM API * Fix embeds * Update example env * Smard --- resources/views/pages/weather.blade.php | 61 --------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 resources/views/pages/weather.blade.php (limited to 'resources/views/pages/weather.blade.php') diff --git a/resources/views/pages/weather.blade.php b/resources/views/pages/weather.blade.php deleted file mode 100644 index a759534..0000000 --- a/resources/views/pages/weather.blade.php +++ /dev/null @@ -1,61 +0,0 @@ -@extends('layouts.default') -@section('title', 'Weather') -@section('description', 'Data from my weather station') -@section('content') -@php -$api_root = app('config')->get('app')['api_root']; - -function degreesToCompassDirection($degrees) { - $cardinalDirections = [ - 'N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', - 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N' - ]; - return $cardinalDirections[round($degrees*16/360)]; -} - -$api_alive = true; - -try { - $data = file_get_contents($api_root.'/weather'); -} catch (Exception $e) { - $api_alive = false; -} -@endphp -@if (!$api_alive) - @include('components.errors.api-error') -@else - @php - $data = json_decode(file_get_contents($api_root.'/weather')); - $updated = gmdate('H:i Y-m-d', $data->updated); - $data = $data->current; - @endphp - - - - - - - - - - - - - - - - - - - - - - - -
-(Last Update: {{ $updated }}) -@endif -@stop -- cgit v1.2.3-54-g00ecf