Inspiration
My Inspiration for this project was mainly in regards to the topic: "Write a script to analyze article titles." I have been itching to try out the New York Times API to get my hands on any data possible, and for the first time, I had learned how to integrate it into my website which was an amazing experience. I have been more used to web scraping using BeautifulSoup4, but this worked great with JavaScript! I was also able to reach my end goal which was determining the health of the economy based on the word association of articles on NYT.
What it does
I have built a website: https://nyt-headlines-project.mmirchan.repl.co/ I have coded this site to use New York Times API to form a curated list of the most recent articles solely on the health of the economy. From this, I have assigned metrics using word association to determine if there are any patterns in how the state of the economy is currently. Using words like "inflation" and "unemployment" I am able to get a simple grasp of the state of the economy today with a couple of simple article headlines.
How we built it
I built this using repl.it which gave me access to HTML, JS, and CSS templates. I was able to quickly make a website for this hackathon using this service and now I can share the link with anyone! I also used NYT API to build this. After researching a couple of tutorials and debugging every error I ran into, I was successful in making an easy and digestible website that stated whether today was a good day or a bad day for the economy. I think the next step is to see how this news correlates with the stock market prices of the average index fund. Maybe that can even be a contributing metric/factor to see if the economy is better or worse!
Challenges we ran into
One of the problems I faced was getting the API to work. I have had no experience with the New York Times API, so following a couple of tutorials led me to a lot of success with grabbing a lot of data and turning it into a JSON object for instance. Then later I applied maps and filters to form my curated list of articles that I wanted to see. And the finishing touch was to get a final valuation to assess the health of the economy and this final step was the one that ran into an annoying problem that I later learned to use a delay for. It was clear to me that APIs are not the fastest thing in the world, but that was fine as long as I could gather that data and calculate something off of it! I finally had gotten a string to represent all articles, and from that I was able to compare it to an array of healthy economic words and unhealthy economic terms to assess the health of the economy.
Accomplishments that we're proud of
I was proud to get the API successfully working, and get a proof of concept on concluding the health of the economy with this simple idea. Within a couple of hours of coding this throughout the night, I was able to actually pull it off!
What we learned
I had learned a lot about JavaScript that I definitely forgot along with CSS concepts and HTML concepts. I was also proud to integrate an API I have never used before.
What's next for Economic Glimpse
What's next is maybe using NPL and better word association to calculate the current health of the economy. Unfortunately, the script I run can only do so much. One problem I had noticed is that good economic words include the word "good" and "excellent" however, these can also be mistaken for "not good" and "not excellent" which would contribute to being something positive instead of negative, and I would need a lot more time to fix this. However, as an average of every good and bad word in NYT article headlines for the state of the economy, the calculations I have done should be sufficient to determine a strong and clear enough conclusion about the current state of the economy. I was able to confidently get the "general sentiment of the story from only the title" as the project description had mentioned.
Log in or sign up for Devpost to join the conversation.