A retail related hack was of interest to our team as we have all experienced the lulls and glamours of online shopping. We drew most of our experience from Amazon and the like and decided to apply that knowledge into creating a tool to ease shopping practices as we would like to see it changed. Coupled with HyVee's presence at HackISU, we found that the nutrition labels were a few clicks away when we thought that would be the most important thing a consumer should be seeing.

What it does

Checkout Nutrition would be a Chrome extension that lists the products in the cart, the calories of each product in the cart, the main macro nutrients in the products, and a total of the above parameters at the end.

How we would have built it

We utilized Javascript to scrape the HTML data from the HyVee page which allowed us to grab the names of the products. We then used Cross-Origin XMLHttpRequests to get the data of the product from a search of the MyFitnessPal database without switching the web page (as the extension only works on the HyVee page). With all the data, all that was left was to format it into a Chrome extension and create a website to accompany. There was also a Python version of the script originally, but was abandoned despite its working status since embedding a Python script into the website was not particularly simple (going into AWS Lambdas looked to be the best bet, but none us had experience with AWS to begin with).

Challenges we ran into

HyVee does not have an API for their data, which made the collection of said data very difficult. MyFitnessPal did have an API, but it was private and did not reply to us in time for us to use the API functions in place of requesting the HTTP data from a search of their website and parsing through that. Finally, deploying the Javascript code from the local console worked fine, however when we put the code into the extension and loaded it, there were numerous issues of not retrieving data, incorrect permissions to do Cross-Origin requests, and the like that made collecting the necessary information impossible in our time.

Accomplishments that we're proud of

Javascript was a very wild language to dive into, and honestly, being able to use it at our first encounter made us very proud. None of us had any prior experience to web scraping and development so it was very neat to do groundbreaking work in a completely foreign area of computer science.

What we learned

Basic web scraping and Javascript were new to all of our members, so being able to learn and apply that knowledge quickly was both surprising and very rewarding. There was also details about deploying websites and using Git with multiple members in a real-time scenario that contributed to what we learned.

What's next for Checkout Nutrition

Getting the cross HTTP requests to work outside of the console and in the Chrome extension.

Share this project: