From 3226d36fed370323ae8ca12f71a9db552e79bf60 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Tue, 4 Feb 2025 19:21:46 -0500 Subject: [PATCH] Rename executable to spotilist --- server.pl | 44 -------------------------------------------- spotilist.pl | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 server.pl create mode 100644 spotilist.pl diff --git a/server.pl b/server.pl deleted file mode 100644 index cb55c31..0000000 --- a/server.pl +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env perl -use strict; -use warnings; - -use Mojolicious::Lite; - -my $CLIENT_ID = $ENV{SPOTIFY_CLIENT_ID}; -my $CLIENT_SECRET = $ENV{SPOTIFY_CLIENT_SECRET}; -if (!$CLIENT_ID || !$CLIENT_SECRET) { - die "Spotify Env Vars not set\n"; -} - -my $AUTH_URL = "https://accounts.spotify.com/authorize" - . "?client_id=$CLIENT_ID" - . "&response_type=code" - . "&redirect_uri=http://localhost:3000/auth" - . "&scope=playlist-read-private&playlist-read-collaborative" - . "&state=" . int(rand() * 100); - -get '/' => sub { - my $c = shift; - $c->render( - template => "index", - AUTH_URL => $AUTH_URL, - ); -}; - -get 'auth' => sub { - my $c = shift; - $c->render(text => "Your code is:\n" . $c->param("code")); -}; - -app->start; - -__DATA__ - -@@index.html.ep -

Spotify Playlist Exporter

-

Hello and welcome to the Spotify Playlist Exporter!

-

To start, first log in to Spotify and authorize this -app by clicking the link below:

-> -Authorize - diff --git a/spotilist.pl b/spotilist.pl new file mode 100644 index 0000000..cb55c31 --- /dev/null +++ b/spotilist.pl @@ -0,0 +1,44 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +use Mojolicious::Lite; + +my $CLIENT_ID = $ENV{SPOTIFY_CLIENT_ID}; +my $CLIENT_SECRET = $ENV{SPOTIFY_CLIENT_SECRET}; +if (!$CLIENT_ID || !$CLIENT_SECRET) { + die "Spotify Env Vars not set\n"; +} + +my $AUTH_URL = "https://accounts.spotify.com/authorize" + . "?client_id=$CLIENT_ID" + . "&response_type=code" + . "&redirect_uri=http://localhost:3000/auth" + . "&scope=playlist-read-private&playlist-read-collaborative" + . "&state=" . int(rand() * 100); + +get '/' => sub { + my $c = shift; + $c->render( + template => "index", + AUTH_URL => $AUTH_URL, + ); +}; + +get 'auth' => sub { + my $c = shift; + $c->render(text => "Your code is:\n" . $c->param("code")); +}; + +app->start; + +__DATA__ + +@@index.html.ep +

Spotify Playlist Exporter

+

Hello and welcome to the Spotify Playlist Exporter!

+

To start, first log in to Spotify and authorize this +app by clicking the link below:

+> +Authorize + -- libgit2 1.8.1