NPR API CLI gem – OO Assessment

In my program each major unit ends with a few projects. There are a couple of projects that just feel like really long labs, and then there is a final project that is a bit more open-ended (AKA fun). After you’ve finished your project, you’re required to film a video walkthrough, write a blog post about the experience, and lastly you have an assessment with a Flatiron instructor.

For the object-oriented Ruby section, they asked us to create a CLI gem that scraped data from a webpage or via an API. Despite having a little experience with web scraping and APIs in Python, it still took me a while to get my head around the best way to approach the project. 

Specific Project Requirements:

  • * Package as a Ruby gem
  • * Provide a CLI on gem installation.
  • * CLI must provide data from an external source, whether scraped or via a public API.
  • * Data provided must go at least a level deep, generally by showing the user a list of available data and then being able to drill into a specific item.

My Gem Overview / Walkthrough

I built a gem that connects to the NPR API. Through the command line you can pick an NPR radio program and see its recent stories, then drill into those stories to see further information. You can also choose to read the whole story through the browser.

The interface looks like this:

npr-stories-gem

Here is the video walkthrough of my gem:

Read more

Knit Tracker – Sinatra Assessment

When I first saw the Final Projects for the object orientation section of my program, I was intimidated. OO was hard! And creating a CLI gem just sounded like a lot at the time. I felt differently upon reaching the Sinatra assessment. The project requirements seemed simple enough: create a CRUD app using Sinatra and ActiveRecord. As the labs building up to this project had made me do this several times over, I felt ready to create my own. Actually pulling it together wasn’t simple by any stretch, but it was certainly not as intimidating as the CLI gem (which I’m still working on!).

Specific Project Requirements:

  • * Build an MVC Sinatra Application
  • * Use ActiveRecord with Sinatra
  • * Use Multiple Models
  • * Use at least one has_many relationship 
  • * Must have user accounts. The user that created the content should be the only person who can modify that content
  • * Models must have validations to ensure that bad data isn’t created 
  • * Any validation failures must be shown to user with an error message

Read more

Scroll To Top