Building a Spotify Tracker with ChatGPT: Tips and Lessons Learned
Header generated and edited with Microsoft Designer

Building a Spotify Tracker with ChatGPT: Tips and Lessons Learned

Up until recently, I had primarily used ChatGPT for outline ideation, light editing, and research through targeted prompting. I had read articles about people using this or similar tools to create websites and apps, but I had never attempted such tasks myself. This all changed over the past weekend when I decided to take the plunge and create a Google Sheets extension to track my Spotify plays, despite my lack of coding skills or knowledge of Spotify’s API.

In this newsletter, I wanted to share my experience of working with ChatGPT to develop a Google Sheets extension for tracking Spotify plays. This task took over 8 hours across two sessions utilizing both chatGPT 3.5 and chatGPT 4. Additionally, I'll provide tips and examples to help you effectively work with ChatGPT and perhaps also empower you to create whatever app or tool your heart desires.

The Beginning

As a music lover and avid user of Spotify, I have loved tracking my plays and analyzing my listening habits so much that I pay for an app called Stats FM for Spotify that does exactly that. To be honest, I did not need to create this extension but I was curious to learn if I could create my own way of doing it and if chatGPT could help.

My experience with coding has been limited to scratch and enough knowledge to guide students through python, with additional support. I have no experience with javascript so this is not a project that I could have done myself without taking proper courses to learn. I think that is what makes chatGPT and tools like it so powerful in that a person with limited skills should be able to create through prompting, discussion, and feedback. Even knowing this, the complexity of this project meant not just grabbing lines of code but also learning how to utilize Spotify API, navigate tokens, authorizations across two platforms, and somehow create a working product that does as intended.

Working with ChatGPT

During our first session, I began by asking ChatGPT about the necessary steps to create a Google Sheets extension that could access my Spotify play history. With the AI's guidance, I learned about the Spotify API and how to authenticate my Google Sheets with it using Google Apps Script. This allowed me to access my Spotify data, which was a crucial first step in building the extension.

I should also mention that in addition to not having the coding skills for this complex project, I also did not know how to leverage Spotify’s API. In the past, I had created a few python projects for Twitter, and while the mechanics of signing into the developer console, creating an “app”, and locating client IDs, secret codes, and tokens were similar, it was also very different. Thankfully chatGPT helped me navigate each step. Whenever I didn’t know what to do, I asked for help, and ChatGPT provided step-by-step instructions.

The same applied to Google Apps Script. Together, we developed code snippets and implemented them into the Google Apps Script environment. ChatGPT provided explanations for each piece of code, which helped me understand not only what I was doing but also why I was doing it. Learning about “the why” mattered to me, so I was thankful that this information was included with each step.

Challenges and Overcoming Them

As I mentioned earlier, this task took a little over 8 hours to complete. There were challenges. Boy, were there challenges! Here is a list of challenges and how we overcame them.

Google has obviously made changes to Google Apps Script, and with chatGPT working from knowledge from years prior, many instructions referenced menus that were no longer there. In addition, we went back and forth on lines of code that needed constant editing to the point that both the AI and I were confused. The only real way to overcome this is to be patient. The more that you progress and share error messages, the more that the AI adapts to overcome the error, and it may take quite a few exchanges to get there.

With chatGPT 4, you only get so many exchanges in a time period, and I was eventually prompted to wait a few hours or to use chatGPT 3.5. The experience of the two was night and day, even in the tone of the responses. One thing that chatGPT 3.5 did that 4 didn’t was to help me create a sidebar panel for authentication. Other than that, the time that I spent with chatGPT 3.5 was really just waiting for chatGPT 4 because, other than the side panel, we went more backward than forward.

Another challenge was that chatGPT seemed to be limited in how much code it can share at once. Many exchanges of partial code were shared, and to overcome this, I asked that the AI only share a small portion of code at a time and to wait for a prompt of “next” to share the rest. This worked beautifully, and I would highly recommend doing it.

Achieving Success

This is a screenshot of my google sheets spreadsheet showing my Spotify track plays which include time, artist, song and album.
My spreadsheet of Tracked Spotify Plays

The moment that my code worked felt like my first time experiencing the connected LEDs of my python projects light up. It’s an indescribable feeling that can only be felt when one accomplishes a task that they worked so hard to do. Yes, the AI did the heavy lifting, but after spending what amounts to a workday trying to navigate everything from API to token authentication, secure websites for callback, broken code, and more, this felt like work! Yes, it is 100% due to me not having the skills, but with all that I learned in a day, it was worth it.

My Spotify Google Sheets extension allows me to track current plays with a trigger, but by initiating a timed trigger, I can track all day or as much as Spotify’s API allows me to track before limiting.

There are much better ways of doing this, and like I said, I have an app. There are other apps too. None of that matters because my goal was to create something with code and not just prompt for writing. Now, I am more curious to learn JavaScript and go even further to make some other much more useful app, even if it takes the equivalent of an entire workday.

Tips for Working with ChatGPT on Similar Tasks

  1. Define your goals and requirements: Be clear about your project's objectives and desired outcomes. I know that I did not use a good prompt and simply asked for help creating a google sheets extension that tracked Spotify plays using Spotify's API. The better the prompt, the stronger the results.
  2. Break down your project into smaller tasks: Divide your project into manageable steps. For example, "First, I need to learn how to access the Spotify API. Then, I'll need to retrieve my play history and import it into Google Sheets."
  3. Ask specific questions: The more specific your questions, the more targeted the guidance you'll receive from ChatGPT. For example, when I was given instructions that I did not understand, I specifically asked for help with the parts that I did not get and also provided context of any knowledge that I had.
  4. Be patient and iterate: Understand that complex projects may take time and require multiple sessions. There were times when I wanted to give up and came very close. Persistence is key.
  5. Test and debug: Regularly test your code and troubleshoot any issues with ChatGPT's help. For example, I copied each error message and shared it back to chatGPT as they appeared. This helped the troubleshoot process but also helped the AI learn more about how the platform worked. I eventually just pasted my code into chatGPT and the results after some time were much better.

Felix Jacomino

Director of Technology at St. Stephen's Episcopal Day School

1 年

Brilliant!! Keep these coming... I learn so much from them :)

回复

Thanks for sharing!

回复

要查看或添加评论,请登录

Rafranz Davis的更多文章

  • Using AI to Reflect, Realign, and Plan What’s Next

    Using AI to Reflect, Realign, and Plan What’s Next

    When I began creating course content for L&D, I knew it was an opportunity to lean on my past experiences in K-12..

    9 条评论
  • How K-12 Professional Learning Informs My Approach to Corporate L&D Content

    How K-12 Professional Learning Informs My Approach to Corporate L&D Content

    As a content manager at LinkedIn Learning, I manage content across multiple areas, including finance and accounting…

    18 条评论
  • Learning Through Transition: From K-12 to LinkedIn

    Learning Through Transition: From K-12 to LinkedIn

    For over 15 years, my professional journey was deeply rooted in K-12 education. From the classroom to tech training and…

    19 条评论
  • Getting Started with AI for Educators

    Getting Started with AI for Educators

    Recently, I've received numerous inquiries about where to begin learning about Generative AI. Given the hours that I've…

    2 条评论
  • Engineering in the World of Entertainment

    Engineering in the World of Entertainment

    Last week, I spent my first week taking a bit of a deep dive into AEC and the content that I manage here at LinkedIn. I…

    5 条评论
  • Learning Out Loud: My Deep Dive into the AEC Industry

    Learning Out Loud: My Deep Dive into the AEC Industry

    When I started this newsletter, the intent was for me to create my own little space to share my learning out loud..

    5 条评论
  • How ChatGPT Revolutionized My Learning and Work

    How ChatGPT Revolutionized My Learning and Work

    I realized today that next month will mark a year in my new role. Reflecting on the journey of learning over the last…

    10 条评论
  • GenAI Art and Human Creation

    GenAI Art and Human Creation

    I have an 18-year-old nephew who is a brilliant state medal-winning artist. Right now, we are going through the final…

    5 条评论
  • A Brief Reflection on Learning and a Little More ChatGPT

    A Brief Reflection on Learning and a Little More ChatGPT

    Today was an amazing learning day. It started out pretty powerfully but ended even more so as I got to spend some time…

    5 条评论
  • How I Used ChatGPT as a Thought Partner

    How I Used ChatGPT as a Thought Partner

    Last week I took several courses on Generative AI right here from the Linkedin Learning library. One, in particular…

    9 条评论

社区洞察

其他会员也浏览了