diff --git a/_already_sent/.gitkeep b/_already_sent/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/_already_sent/0cf7dedb7cfac4340056a612bc3c50b1.txt b/_already_sent/0cf7dedb7cfac4340056a612bc3c50b1.txt new file mode 100644 index 00000000..a963820c --- /dev/null +++ b/_already_sent/0cf7dedb7cfac4340056a612bc3c50b1.txt @@ -0,0 +1 @@ +https://www.openculture.com/2025/05/how-frank-lloyd-wrights-architecture-evolved-over-70-years-and-changed-america.html \ No newline at end of file diff --git a/_already_sent/12b2cc8c05f23758c6e812ef34044f53.txt b/_already_sent/12b2cc8c05f23758c6e812ef34044f53.txt new file mode 100644 index 00000000..83138f71 --- /dev/null +++ b/_already_sent/12b2cc8c05f23758c6e812ef34044f53.txt @@ -0,0 +1 @@ +https://en.wikipedia.org/wiki/Rainhill_trials \ No newline at end of file diff --git a/_already_sent/3f2721d52927f2d2c5f1146665b441dd.txt b/_already_sent/3f2721d52927f2d2c5f1146665b441dd.txt new file mode 100644 index 00000000..e60c2b8a --- /dev/null +++ b/_already_sent/3f2721d52927f2d2c5f1146665b441dd.txt @@ -0,0 +1 @@ +https://fossforce.com/2025/04/is-free-or-open-source-software-sustainable/ \ No newline at end of file diff --git a/_already_sent/8eef8d9550fb4952c4ef2ba2656b4038.txt b/_already_sent/8eef8d9550fb4952c4ef2ba2656b4038.txt new file mode 100644 index 00000000..db0cfd4f --- /dev/null +++ b/_already_sent/8eef8d9550fb4952c4ef2ba2656b4038.txt @@ -0,0 +1 @@ +https://manualdousuario.net/en/writing-chatgpt-ai/ \ No newline at end of file diff --git a/_already_sent/a3ffc5f64551046ad7132d159f1f40e7.txt b/_already_sent/a3ffc5f64551046ad7132d159f1f40e7.txt new file mode 100644 index 00000000..2e5d8665 --- /dev/null +++ b/_already_sent/a3ffc5f64551046ad7132d159f1f40e7.txt @@ -0,0 +1 @@ +https://goblackcat.com/feeling-exhausted/ \ No newline at end of file diff --git a/_already_sent/db41d26877002dfa9dba650122b8a298.txt b/_already_sent/db41d26877002dfa9dba650122b8a298.txt new file mode 100644 index 00000000..8b80b665 --- /dev/null +++ b/_already_sent/db41d26877002dfa9dba650122b8a298.txt @@ -0,0 +1 @@ +https://fenati.org.br/brasil-prepara-marco-regulatorio-para-data-centers-com-beneficios-fiscais-e-regras-sustentaveis/#datacenter \ No newline at end of file diff --git a/_credentials/.gitkeep b/_credentials/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/add_to_fedilist.php b/add_to_fedilist.php index a9aff48a..74a2b7d5 100644 --- a/add_to_fedilist.php +++ b/add_to_fedilist.php @@ -1,87 +1,31 @@ $refreshSecondMargin) { - $minutes = floor($secondsLeft / 60); - $seconds = $secondsLeft % 60; - echo "⏳ Token expires in $minutes minutes and $seconds seconds.\n"; - } else { - echo "🔄 Access token expired or will expire in less than $refreshSecondMargin seconds. (Seconds Left: $secondsLeft). Refreshing...\n"; - - $refreshResponse = curlPost('https://oauth2.googleapis.com/token', [ - 'client_id' => $clientId, - 'client_secret' => $clientSecret, - 'refresh_token' => $token['refresh_token'], - 'grant_type' => 'refresh_token' - ]); - - if (isset($refreshResponse['access_token'])) { - $token['access_token'] = $refreshResponse['access_token']; - $token['expires_in'] = $refreshResponse['expires_in']; - $token['expires_at'] = time() + $refreshResponse['expires_in']; - file_put_contents($tokenPath, json_encode($token)); - echo "✅ Token refreshed.\n"; - } else { - echo "‼️ Failed to refresh token: " . ($refreshResponse['error'] ?? 'unknown') . "\n"; - return false; - } - } -} - - - // === Extract video ID === + // Extract video ID from URL if (!preg_match('/(?:v=|\/)([a-zA-Z0-9_-]{11})/', $videoUrl, $matches)) { echo "⁉️ Invalid YouTube URL: $videoUrl\n"; return false; - } + } $videoId = $matches[1]; // === Step 1: Check if video is already in playlist === diff --git a/update_google_token.php b/update_google_token.php index 82ed8075..f183070a 100755 --- a/update_google_token.php +++ b/update_google_token.php @@ -1,8 +1,6 @@ #!/usr/bin/php $clientId, @@ -98,24 +109,22 @@ while (true) { ]); if (isset($tokenResponse['access_token'])) { - $tokenResponse['expires_at'] = time() + $tokenResponse['expires_in']; - $path = __DIR__ . '/_credentials/token.json'; - file_put_contents($path, json_encode($tokenResponse)); - echo "\n✅ Token saved as $path.\n"; - break; + $token = $tokenResponse; + echo "Saving token.json\n"; + file_put_contents(__DIR__ . '/_credentials/token.json', json_encode($token)); + break; } - if (isset($tokenResponse['error']) && $tokenResponse['error'] !== 'authorization_pending') { - die("\nAuth error: " . $tokenResponse['error'] . "\n"); + die("Auth error: " . $tokenResponse['error'] . "\n"); } if (time() - $startTime > $deviceData['expires_in']) { - die("\nAuthorization timed out.\n"); + die("Authorization timed out.\n"); } } // === Step 3: Create FediList Playlist === -createPlaylist($tokenResponse['access_token']); +createPlaylist($token['access_token']); ?> diff --git a/utils.php b/utils.php deleted file mode 100644 index 39efbd04..00000000 --- a/utils.php +++ /dev/null @@ -1,21 +0,0 @@ -