diff --git a/Push-AntigravityQuota.ps1 b/Push-AntigravityQuota.ps1 new file mode 100644 index 0000000..524eafc --- /dev/null +++ b/Push-AntigravityQuota.ps1 @@ -0,0 +1,27 @@ +param ( + [string]$TokenWatchUrl = "http://token.orfel.de/api/webhook/antigravity", + [int]$WeeklyRemaining = 43, + [int]$FiveHourRemaining = 87, + [string]$WeeklyRefresh = "19 hours, 44 minutes", + [string]$FiveHourRefresh = "4 hours, 35 minutes" +) + +# Erstelle den Payload für den Webhook +$payload = @{ + weekly_limit_remaining = $WeeklyRemaining + five_hour_limit_remaining = $FiveHourRemaining + weekly_refresh = $WeeklyRefresh + five_hour_refresh = $FiveHourRefresh +} + +$jsonPayload = $payload | ConvertTo-Json + +Write-Host "Sende Quota an TokenWatch ($TokenWatchUrl)..." +Write-Host $jsonPayload + +try { + $response = Invoke-RestMethod -Uri $TokenWatchUrl -Method Post -Body $jsonPayload -ContentType "application/json" + Write-Host "Erfolgreich gesendet: $($response.message)" -ForegroundColor Green +} catch { + Write-Host "Fehler beim Senden an TokenWatch: $_" -ForegroundColor Red +}