Add PowerShell script for Windows Task Scheduler to push Antigravity quota
This commit is contained in:
1 parent
0a2368e3e7
commit
d9c4c5e123
1 file changed
+27
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user