Inspiration

We wanted to try something new, something that we had no clue how to do or where to start. So naturally we picked web development, working with APIs, and AI language models.

What it does

The goal was to create a website that lets a User log into their Spotify account, pulling their 10 most recently listened to songs. From there the website would grab the lyrics of those songs and run them through a Sentiment and Emotion analyzer to extrapolate and visually showcase that data.

How we built it

Python - due to Python's flexibility and the many existing libraries we first started working and experimenting and implementing our API here!

HTML - we learned the basics of HTML to produce our website from our Python code.

Spotify API - Spotify provides detailed Web API documentation that we used to attempt to start pulling user data.

AZlyrics API - We ran into the challenge that Spotify's API does not support pulling lyrics, so we used AZlyrics.com's API to be able to create txt files of lyrics from the songs we grabbed with the Spotify API

VaderSentiment - is the Sentiment analyzer we used. We spent a lot of time researching and trying to figure out what the results actually meant and how to visualize them in a way that makes sense

Challenges we ran into

Spotify's API is very obtuse and rigid needing to create lots of access, refresh, and authorization tokens to actually access any user data this was where we struggled a lot trying to figure out how to read the documentation and write Python code that correctly accessed the information we were looking for.

  • We were able to access Spotify's library but we were unable to access user data. We ended up spending a long time researching how to do that and realized it had to do with Authorization privileges. So we ended up connecting our website to individual Spotify users' accounts!

  • We also did not know that Spotify did not have an API that supported lyric exporting, so that caught us off guard and forced us to learn another API on top of that.

  • We are stuck at a point where we are refreshing the authorization token manually and inputting it into our code whenever it expires every hour or so. This is far from ideal so it is a goal of ours to improve!

We struggled with figuring out how to create graphs on our website so we bypassed the HTML we didn't know how to use by creating a png of our graph in our code and inputting that into our website.

It was difficult to understand how to read data from the different language models. Our original plan was to be way more ambitious than just positive or negative. But due to time restrictions (and paywalls) we settled for vaderSentiment.

Accomplishments that we're proud of

  • We are extremely proud of everything we managed to accomplish. We walked into this with pretty much no web development experience and although we do not have a shippable product we have something that through some creative problem-solving accomplished our main goals:

  • Connect to a user's account using the Spotify API -Pull the user's listening history -Produce the lyrics of those songs -Analyze them using a language model -Produce a visual output!

What is amazing is we did not just learn how to use one API we learned how to use TWO which was super cool and really showed us how far all of us came in our CS career just as sophomore students.

What we learned

We learned the basics of using APIs to pull information from websites and Google and pulling that information into data structures and txt files that make sense and allow us to do interesting things.

We learned the ideas behind language analyzing models, such as opinion mining, which is what we ended up incorporating into our project.

We learned how to link code to our HTML and how to locally produce and host our website to continue to make changes.

We learned how to use a new coding environment through the accessibility and collaborativity of VSCode (sorry Ethan).

We learned how to use Git effectively to not only save our project but also to collaborate on our project in meaningful ways.

What's next for Lyricify

We are excited to keep working on Lyricify as personal projects. The end goal is to make this idea into an actual website that Spotify users can use to see the sentiment and emotions the songs they listen to convey.

Beyond fixing the issues we have run into with OAuth (Spotify's Authentication system that creates all the tokens we need) we plan on adding options that recommend songs with similar sentiment scores.

We also plan on spending more time learning HTML to make our website more aesthetically pleasing and interactable.

In the long term, we are probably going to switch to a different more complex model than vaderSentiment which will give us more interesting data to work with.

Built With

Share this project:

Updates