For this assignment we needed to interpret external data using API’s or by creating a JSON file. I am one week late on this assignment and still haven’t figured it out.

The main thing I struggled with was making sense of the data that was available to me. Learning how to use the search tools and navigate it was a journey in itself but then understanding that data and extracting it in a way that made sense was even more difficult.

My first attempt was with the New York Times API. After conducting one too many searches trying to understand how the data was documented and getting kicked out of the system because of them, I finally understood the way it was set up. What I wanted to do was look at all the articles written regarding the opioid crisis in the United States and separate what adjectives were used to describe the victims or fatalities. I could not figure it out. Even when extracting just the articles that mentioned opioids and not focusing on keywords, the system would say lets say 1966 matches but when I opened the file it would only give me 10 articles.

After spending entirely too many days trying to make sense of this, I gave up and moved on to a new idea.

I then decided to use the lyrics from one of my favorite albums which also happened to have a very fitting title - Stop Making Sense by Talking Heads. I went on to APISEEDS and downloaded a separate JSON file for every song in the album. Then I used JSON viewer to fix the format and uploaded all 16 files to P5. First I couldn’t get the files to actually load onto my sketch so I deleted them all and kept only one for the purpose of experimenting. The file wouldn’t load still. At one of the office hours one of the residents suggested I use JSON validator which would check that my file was properly written. Thanks to this I noticed I had an extra comma at the end of the file. Once I fixed that I was able to load the one file (didn’t try the remainder 15). At this point I also noticed something else. The lyric part of the JSON files were written in a continuous string separated by /r and /n’s.

Screen Shot 2018-11-01 at 1.08.05 AM.png

I couldn’t figure out how to pull out specific words from these strings in all 16 files so I created a new file that only used the titles from each song as a starting point.

Screen Shot 2018-11-01 at 1.08.20 AM.png

I finally was able to move on to the code part but I am now struggling with getting the button and mousePressed function to pull the titles.

To be continued….

Here is the link to the code: