I'm currently learning Rust and needed a project to work on. After building a Syntax.fm extension for Raycast, I wanted to add the ability to launch episodes natively in Spotify. However, this requires each episode to have a Spotify identifier.
This small Rust tool solves that problem by collecting shows from the Syntax.fm repository and updating each episode's frontmatter with its corresponding Spotify URL. Note that you must clone the repository and run this tool from within its directory.
All Spotify endpoints require app authorization; you will need to generate a token that indicates that the client has been granted permission to perform requests. You can start by registering your app to get the necessary client credentials.
Set the Redirect URI to http://localhost:8080/callback
and the select the Web API
SDK type.
The program requires the following environment variables to be set:
RSPOTIFY_CLIENT_ID
: The client ID from the Spotify dashboardRSPOTIFY_CLIENT_SECRET
: The client secret from the Spotify dashboard
You must set these variables in your shell.
- Clone this repository
- Run
cargo install --path .
to build and install the program globally (or runcargo run
to run the program locally for testing but you'll need to make sure you have ashows/
folder in the root directory) - Go into the root directory of the Syntax repository and run
syntax-spotify-transformer
to start the program - The first time the program runs, it will prompt you to authorize the app to access your Spotify account. You will be redirected to a URL that looks like
http://localhost:8080/callback?code=...
You must copy this URL and paste it into your terminal. - The program will run until it has updated all the shows
- If the tool fails to process a show, or if multiple entries are found for a given date (some episodes have inconsistent frontmatter), it will print the list of skipped shows to the console at the end. These shows will require manual intervention to update their frontmatter.