On reddit.com/r/kpop, there is a wonderfully-mintained wiki that keeps track of all the musical releases from various K-Pop artists. The wiki is updated every month with a table full of info about the releases. Here is a link to the wiki.
This script parses that wiki table, extracts the Spotify links to the releases, and then puts them into a playlist on Spotify.
The playlists can be found on Spotify.com.
The script basically does the following:
- Gets the current month + year
- Grabs the current-month's releases wiki from Reddit
- Extracts out all the Spotify links currently in the wiki
- Fetches the Spotify playlist for the corresponding month + year, or creates one if doens't exist
- Inserts each of the releases into the playlist
The main logic is written in PHP with SQLite3 as the data store.
Simple as just
php script.php
The various modules that power the script make use of values stored in a local .env
file. The .env
file is NOT included in this repo as it contains secrets. A .env.ini.example
is provided for reference as to the schema of the file.
The database is dead simple. Just two tables.
playlists
— which stores the Spotify ID for the playlist of a given month + yearprocessed
— which is just a list of all the raw-links that we have already-handled from the reddit wiki
Can see the specifics in the spotify.db.schema
file.