mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
mempool weather added
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Console\Commands\MempoolSpace;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use OpenAI;
|
||||
|
||||
class CacheRecommendedFees extends Command
|
||||
@@ -25,6 +26,7 @@ class CacheRecommendedFees extends Command
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
try {
|
||||
$apiKey = config('services.open-ai.apiKey');
|
||||
$client = OpenAI::client($apiKey);
|
||||
|
||||
@@ -47,5 +49,8 @@ class CacheRecommendedFees extends Command
|
||||
|
||||
cache()->put('mempool-weather', $result['choices'][0]['text'], now()->addMinutes(62));
|
||||
cache()->put('mempool-weather-changed', now()->toDateTimeString(), now()->addMinutes(62));
|
||||
} catch (\Exception $exception) {
|
||||
Log::error($exception->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,15 @@
|
||||
Blockhöhe <span class="font-bold text-2xl ml-4" x-text="height && height.toLocaleString('de-DE')"></span>
|
||||
</span>
|
||||
</div>
|
||||
@if(!empty($weather))
|
||||
<div class="text-md leading-6 text-gray-900 text-center max-w-screen-2xl">
|
||||
{{ $weather }} (um {{ \App\Support\Carbon::parse($changed)->asTime() }} Uhr aktualisiert - stündlich)
|
||||
</div>
|
||||
@else
|
||||
<div class="text-md leading-6 text-gray-900 text-center max-w-screen-2xl">
|
||||
Wetterdaten werden in Kürze wieder verfügbar sein. (OpenAI Quota exceeded)
|
||||
</div>
|
||||
@endif
|
||||
<div
|
||||
x-data="{
|
||||
fastestFee: null,
|
||||
|
||||
Reference in New Issue
Block a user