diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache deleted file mode 100644 index bc404ecb..00000000 --- a/.php-cs-fixer.cache +++ /dev/null @@ -1 +0,0 @@ -{"php":"8.2.29","version":"3.86.0:v3.86.0#4a952bd19dc97879b0620f495552ef09b55f7d36","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const_import","do","else","elseif","final","finally","for","foreach","function","function_import","if","insteadof","interface","namespace","new","private","protected","public","static","switch","trait","try","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"fedi_slurp.php":"2cbe2b549c703ecb4a3be4f2e15694f9"}} \ No newline at end of file diff --git a/update_google_token.php b/update_google_token.php index 82ed8075..71469ce5 100755 --- a/update_google_token.php +++ b/update_google_token.php @@ -15,13 +15,14 @@ $clientId = $client['client_id']; $clientSecret = $client['client_secret']; // === Create playlist helper === -function createPlaylist($accessToken) { +function createPlaylist($accessToken) +{ $path = __DIR__ . '/_credentials/fedilist_id.txt'; - if (file_exists($path)) { - echo "āœ… FediList Playlist ID already exists at :$path\n"; - return; + if (file_exists($path)) { + echo "āœ… FediList Playlist ID already exists at :$path\n"; + return; } $data = [ @@ -53,12 +54,12 @@ 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']); -} else { - echo "Failed to create playlist:\n$response\n"; -} + if (isset($result['id'])) { + echo "FediList created!\nPlaylist ID: " . $result['id'] . "\n"; + file_put_contents($path, $result['id']); + } else { + echo "Failed to create playlist:\n$response\n"; + } } @@ -98,11 +99,11 @@ 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; + $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; } @@ -117,5 +118,3 @@ while (true) { // === Step 3: Create FediList Playlist === createPlaylist($tokenResponse['access_token']); - -?>