CLI Data Gem APP 鋸 ⌗
At the Flatiron School, my most recent project was to create a CLI App that scrapes data using Nokogiri. Nokogiri is code that you can use to extract data from a website by selecting HTML elements.
So you have a creative project to do. It could be anything from programming a CLI App to writing an essay. But what topic do you choose? Well ask yourself, what are your passions?
The project was to program a CLI Data Gem App. The scope is a simple command line interface application that scrapes a web page or two and outputs the data. My first idea was to scrape the entire Apple Store retail locations page and allow a user to type in a state number to read out that states list of store locations until I decided I needed better, more engaging content to scrape for the user. The type of content the terminal can display is text so I searched and found engaging heading, paragraph and symbol text.
I selected the Apple Everyone Can Code webpage for its rich content. Uts heading is clear, it has a beautifully written message about learning to code and logo text at the bottom of the page. I found the corresponding CSS selectors to use in my program. If I was going to provide a final project that works and actually scrapes data, I needed to select a webpage that will last longer than a day or week.
After the creative process, I re-watched the video tutorial from the lesson on how to create the CLI App. I created the App using Xcode and MacOS terminal. I created a Ruby gem, created and setup my .bin file and specified methods to scrape the two websites using Nokogiri. It went very smooth with the step-by-step guidance of the instructor. I had a duplication error in my gemspec, which after some time figured out how to resolve.
The final project is a CLI App that scrapes the Apple Retail & Everyone Can Code webpages. It is a workable CLI that outputs my favorite elements of the site page! It is an amazing experience to create a functional product and live the "magic" of programming!