From 32fa30d0a175e319b451f6b39fbfde3c3e1ebcf8 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Tue, 4 Feb 2025 20:49:09 -0500 Subject: [PATCH] Update README with basic instructions --- README | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/README b/README index a33a4ec..58b282f 100644 --- a/README +++ b/README @@ -1,10 +1,50 @@ -# spotilist +# Spotify Playlist Exporter -Spotify Playlist Exporter +A small tool to export Playlist track listings (with +some minimal metadata) as plaintext for archival +purposes. ## Dependencies -On OpenBSD 7.6 the following packages are required: +Outside standard Perl 5 core modules, the libwww +and Mojolicious modules are required. + +On OpenBSD 7.6 the following packages are sufficient: - p5-libwww - p5-LWP-Protocol-https +- p5-Mojolicious + +## Running + +Spotify uses Oauth2.0 to get authentication tokens scoped +to a specific set of permissions and user session (by +having the user log in and accept said permissions). + +This login process requires a browser. As such, the program +is split into two parts: the authorization flow, and the +CLI itself. + +### Authorization + +Create a Spotify Developer account and an Application. +Put the Client ID and Secret in the SPOTIFY_CLIENT_ID +and SPOTIFY_CLIENT_SECRET environment variables. Make +sure http://localhost:3000/auth is the redirect URL. + +Next, run `get-token.pl` as a Mojolicious server: + + $ morbo get-token.pl + +And visit localhost:3000 in the browser. Click the link +and it should log in, redirect back, and dump the token +into the web page. + +### Playlist Exporter (CLI) + +Put the token from the browser in the environment as +SPOTIFY_TOKEN and run the script cli.pl: + + $ ./cli.pl your-spotify-username + +The listings will be written to the current directory. -- libgit2 1.8.1