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

Scroll To Top