Creates a word cloud from all the lyrics in a specified playlist.
JDK 21+ is needed.
gradle bootJar./gradlew bootJarSeveral environment variables need to be set to retrieve oauth tokens.
Steps to set this up can be found in Spotify's documentation.
After that's done, set the client id and client secret as environment variables:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRET
Steps to set this up can be found in Genius' documentation.
After that's done, set the client access token as an environment variable:
GENIUS_CLIENT_ACCESS_TOKEN
The bootable jar will end up at ./build/libs/playlistwordcloudgenerator-0.0.1-SNAPSHOT.jar. Therefore, run this with:
java -jar ./build/libs/playlistwordcloudgenerator-0.0.1-SNAPSHOT.jarAs an example with an actual playlist id (which is required):
java -jar ./build/libs/playlistwordcloudgenerator-0.0.1-SNAPSHOT.jar 2O7Bd3hKzlaF8IjhGmMzo4A word cloud will end up in the ./generated-wordclouds directory with a filename of: wordcloud-PlayListName.png.
This project leverages the Kumo Word Cloud Generator. The parameters to it are over in this method. I normally mess around with the frequencyAnalyzer.setWordFrequenciesToReturn (which sets the maximum amount of words to fit into the word cloud) and/or the wordCloud.setFontScalar(new SqrtFontScalar(10, 60)) (which sets the min / max word size based on the frequency of words). It normally takes a few tires.