Process with CLI project. While working on the CLI (command-line…
By: Kerryann Harry
Tags: Flatiron School, Ruby, Discipline, Software Engineering

While working on the CLI (command-line interface) project for Flatiron I was able to apply the language I learned to a project of my own. Although the project itself is a battle of its own like scraping from a website, having the discipline to do so is a challenge as well. I have little to no previous knowledge of coding before attending flatiron bootcamp. After completing the first three weeks of phase one I noticed I needed to hone in on my old study habits because of how fast paced the bootcamp is. Most of the tools are either within a lesson, article, or even just a question away!

CLI structure :

The purpose of my CLI is to allow to user to receive information on the NFL’s Best teams and players based off of users input. When prompted the user can ask for a specific team rank and roster as well as the top 10 NFL players and their basic information.

Scarping was probably the most frustrating technical part of the whole project. We’re going to look deeper into this by looking at the get team roster method in my scraper file.

The first thing you’ll notice at the beginning of the method is that is says self.get_team_roster with an agreement of team. Moving on to the URL (url) I created a string interpolation to pull the exact information we need based off of the user input. So if the user inputs “Atlanta Falcons” they will receive the team roster. The team roster includes a number of categories filled with data taken from the URL.

I decided that is was important for the user to get the name, position, height, weight, experience and college of each individual player where each team has multiple players. The Row variable holds the selector in which I should get all the data I need. Furthermore, for each individual category I got the attribute their data was in and assigned a variable to them! To add more functionality I sent player.category equal to player_category to use string interpolation later on in the CLI.

Discipline :

Staying organized and responsible was really important during these two weeks. It is also important to know what time of day you work best and for how long in what environment. Knowing I want to be able to take a break while getting some work in, I planned for my first two days to be dedicated to getting the supplies and knowledge needed to be successful. While watching Avi’s video: https://www.youtube.com/watch?v=_lDExWIhYKI&feature=youtu.be I created my flow chart. The flow chart is where I wrote step-by-step how I wanted my CLI project to work. I also created flashcards during this time to stay familiar with the terminology. The next 10 days (or so) were then used to build my CLI.

I started by creating my environment file then my cli file via ruby with fake data because I knew it would take more time to scrape. From there I build my class methods in separate files from there on out I was able to begin scraping!!! Building the skeleton of the command-line interface with fake data was the least stressful part. Good thing I scheduled meetings with my instructor! Office hours were a little hard to attend because of my work schedule so another place you can ask questions are in meetings with your instructor. In my notebook where I created my flow chart, I created an area to write down questions for one-on-one’s, a POA for certain days and random thoughts/ideas. With each Plan of Action, I created SMART goals for any functionality that needed to be add to the interface. I set aside at least four hours a day to code (anywhere between 2–3 hours in the morning and 1+ hours in the evening) during the weekdays, whereas on the weekends I would pick one day (8 hours) to not only code but to read articles on how to apply the language in multiple ways. Some days I did not use my time management skills to the best of my ability, and I would code for about 1 to 2 hours causing me to work over time on the weekends.

Moving forward to be ready for my project review I want to add a few more belles and whistles to the interface. The flashcards are something to go over at least twice daily, reviewing the ins and outs of the program twice a day as well and going over any extra information my instructor has complied for us!