Week 5 — Breeds of Terriers

Sia Chang
2 min readOct 14, 2020

So for this week’s assignment, I worked with API and JSON files to retrieve data from the server.

I originally wanted to create an interface that allows people to enter a zip code, and returns the information of that location using Zippopotam API (http://www.zippopotam.us/). But due to limited experience working with API, I didn’t manage to match the location based on the zip code entered using the API. Here’s a picture of my failed first attempt.

Then I decided to do something easier. So I discovered Dogs API which is based on the Stanford Dogs Dataset. (https://dog.ceo/dog-api/) It allows people to fetch a dog image based on the breed name entered. I chose the subset of terriers dogs and created a simple interaction that allows people to see the breeds’ names of terrier dogs by clicking a button.

An obstacle I encountered was I couldn’t print the list of breeds’ names on the canvas after creating the printBreed function, despite I correctly selected the list as shown in the console.

With a little bit of help from the Professor, I realized I didn’t call printBreed in the draw function, which was why the list wasn’t printed. After changing the printBreed function for spacing adjustment, the list was successfully printed out!

Here’s the code to my super simple (but really tried!) terrier dogs interface:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response