#FirstProjectWithFlatiron

Sean Ransonette
2 min readAug 26, 2020

--

End of MOD 1 is finally here. That means a final project. The project in this case was to create a Command Line Interface or “CLI” using data from an outside source by using either an API or Scrapping. I chose the API method. It seemed to make more sense to me and that really the only reason I chose API over scrapping.

It was suggested that pick a topic that I have interest in. I ended up choosing a Pokemon API or PokeApi as it is called. It has any kind of Pokemon information you could want from Names, types of Pokemon and move sets. Getting the API link was fairly easy, that just depended on the info I was seeking.

I had trouble getting the data I needed at first from the API though. My collect line was originally just

pokemon.collect do |item|

item[“name”]

This returned the names I needed but still within an array within hashes. It also had extra info I did not need in addition to names. It took me a while but I eventually realized that the hash I needed was labeled “results =”. With a slight change to my collect line.

pokemon[“results”].collect do |item|

item[“name”]

After adding [“results”], I returned the needed names of the Pokemon.

Now that I have the names I needed, my CLI worked as planned. The user could enter the numerical ID of the Pokemon and it would return the Pokemon that is attached to that numerical ID.

I was extremely nervous about creating anything using Ruby. I have never done anything like this before. So for a first project, I do not think I did too bad. If you want to check out my basic Pokedex please use this link below.

https://github.com/Sransonette/sransonsette_cli_project

--

--

Sean Ransonette
Sean Ransonette

No responses yet