Skip to content

msmps/syntax-spotify-transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Syntax Spotify Transformer

Motivation

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.

Setup

Authorization

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.

Environment Variables

The program requires the following environment variables to be set:

  • RSPOTIFY_CLIENT_ID: The client ID from the Spotify dashboard
  • RSPOTIFY_CLIENT_SECRET: The client secret from the Spotify dashboard

You must set these variables in your shell.

Usage

  1. Clone this repository
  2. Run cargo install --path . to build and install the program globally (or run cargo run to run the program locally for testing but you'll need to make sure you have a shows/ folder in the root directory)
  3. Go into the root directory of the Syntax repository and run syntax-spotify-transformer to start the program
  4. 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. Example Authorization Flow
  5. The program will run until it has updated all the shows

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages