A CLI project based on Cat Facts API

Ting Z.
1 min readJan 10, 2021

The advice that I held on to the most when starting the CLI project at Flatiron was for it to be simple. I held on to it even after trying different starting points. I spent a couple of days working on a scraper when I realized the college catalog I was working on, was too much of a navigation mess to deal with. Most of the pages I wanted to scrap were under layers of links which looked like it was going against the advice I recently took.

Thus I changed to working with APIs after finding some free APIs that were free and required no tokens. I eventually found two but the second one pulled on my heartstrings and I adopted it!

I chose the API called Cat Facts (https://cat-fact.herokuapp.com/) which is maintained by Alex Wohlbruck (https://github.com/alexwohlbruck). The documentation was short but it fitted the bill.

I worked off bundler to set up the framework and lecturer’s lectures to build the foundation of the application. Afterwards I was left to my own devices.

Working with the different data structures (i.e. JSON, Ruby objects and hashes) greatly confused me and left me tuck on two methods for way too long. Eventually I used some debugging and pry to help figure which was what.

Hopefully with this project I can impress some friends and family members with my coding and my cat trivial knowledge.

--

--