Who doesn’t like a good Happy Hour?? For my CLI project I decided to write a program which scrapes the site Happy-Hour.com and provide the user information on happy hour specials near their location. This program was really difficult, but it taught me so much. Up until now assignments and labs were test driven. I would see what kind of errors I get and fix what it tells me too. But this project was built from the ground up! The most difficult thing was figuring out where to start. I would have an idea of where my project would end up but no idea where to begin. What helped me the most, was to start at the simplest step and take everything a step at a time. Eventually things start to come together, and a program was born!
This program also taught me how to use Nokogiri to scrape the site properly. This was very difficult since some of the data I needed had the same identifiers as some information I didn’t need. To resolve this, I had to gather the text into an array and extract the information I needed, using the each/each_with_index method combined with some logic. Once I got that, creating new instances for each of the restaurants and giving them keys and values was simple.
This project had a lot of ups and downs. One thing I would recommend any newbie coders like me, is to take a walk or step away from the computer for a bit to clear your head. This helped me when I felt like I was stuck and had no idea where to go or how to proceed. It’s strange but for me when I stepped away from the computer, I came back with new ideas to test out. Overall, I learned so much coding this project. It was pretty difficult, but I really enjoyed coding it!