Giter Club home page Giter Club logo

fetch-cats-lab's Introduction

Fetch from Cat API

Getting Started

Fork and clone this repository!

We are going to use what we've learned so far to display a list of images from a fetch request to the Cats API. Take some time to look through the documentation and see if you can make a request from your browser for a list of images. Take a quick peek at their docs. Can you find the base url for this API? Can you limit the number of results to 10? What does the query string look like?

Click to reveal answer!
https://api.thecatapi.com/v1/images/search?limit=10

Requirements

  • An input field for the user to enter the number of cat pictures they want to see
  • A submit button
  • When form is submitted with a valid number, that number of cat photos should display on the page
  • Prevent bad requests: make sure the user can't search for a negative number of cat photos
  • Allow repeated searches: replace old search results with new search results each time the form is submitted

Suggested proccess

It is important to break down any development project into smaller pieces and tackle them one at a time. Here is a list of how you might want to attack this lab.

  • Create your form
  • Prevent default form submission and verify that you can type something into the form
  • Handle bad input (maybe display an error message if the user enters a negative number)
  • Use fetch to make a request. Show data in console.
  • Display the photos! Make sure to remove any old photos from previous form submissions first.

Bonus

  • Use a plug-in or framework to render the photos in a carousel or other cool feature.

Licensing

  1. All content is licensed under a CC-BY-NC-SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

fetch-cats-lab's People

Contributors

bhague1281 avatar brandiw avatar shway250 avatar taylordarneille avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.