Compare commits
No commits in common. "511841b9bf47bf0749fb338595d7493596ee1dbe" and "5cdc25ad9c510ddfb631c4f3f38af01889f4d19a" have entirely different histories.
511841b9bf
...
5cdc25ad9c
1 changed files with 1 additions and 13 deletions
|
@ -32,14 +32,6 @@ function curlPost($url, $data, $headers = []) {
|
|||
|
||||
// === Create playlist helper ===
|
||||
function createPlaylist($accessToken) {
|
||||
|
||||
$path = __DIR__ . '/_credentials/fedilist_id.txt';
|
||||
|
||||
if (file_exists($path)) {
|
||||
echo "FediList Playlist ID already exists at :$path\n";
|
||||
return;
|
||||
}
|
||||
|
||||
$data = [
|
||||
'snippet' => [
|
||||
'title' => 'FediList',
|
||||
|
@ -71,7 +63,7 @@ function createPlaylist($accessToken) {
|
|||
$result = json_decode($response, true);
|
||||
if (isset($result['id'])) {
|
||||
echo "FediList created!\nPlaylist ID: " . $result['id'] . "\n";
|
||||
file_put_contents($path, $result['id']);
|
||||
file_put_contents(__DIR__ . '/_credentials/fedilist_id.txt', $result['id']);
|
||||
} else {
|
||||
echo "Failed to create playlist:\n$response\n";
|
||||
}
|
||||
|
@ -92,9 +84,6 @@ echo "==== DEVICE AUTHORIZATION ====\n";
|
|||
echo "Visit: " . $deviceData['verification_url'] . "\n";
|
||||
echo "Enter code: " . $deviceData['user_code'] . "\n\n";
|
||||
|
||||
echo "Waiting...\n";
|
||||
|
||||
|
||||
// === Step 2: Poll for token ===
|
||||
$token = null;
|
||||
$startTime = time();
|
||||
|
@ -110,7 +99,6 @@ while (true) {
|
|||
|
||||
if (isset($tokenResponse['access_token'])) {
|
||||
$token = $tokenResponse;
|
||||
echo "Saving token.json\n";
|
||||
file_put_contents(__DIR__ . '/_credentials/token.json', json_encode($token));
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue