Git Product home page Git Product logo

soc-w2d5_fetch-hackathon-dadjokes's Introduction

Fetch Hackathon

Today, we will be using our newfound skills to make apps that request data from a server.

Step 1 - Getting data and brainstorming (20 - 30 mins)

Here are some APIs that we can use for free. All but the dad jokes one simply need the url. Each API has documentation on how to ask for different data by changing the url. We have included an example fetch for each one to help you get started.

๐Ÿ‘‰ Send a request to each of the APIs below using your browser's address bar to investigate what you get back and check that the APIs are each up and running.

๐Ÿ‘‰ Try and fetch in your JavaScript and console log until you see the same data you saw in the browser.

๐Ÿ‘‰ Visit the documentation for the APIs and investigate further.

๐Ÿ‘‰ From there, brainstorm what you could make with your knowledge of JavaScript, the DOM and the data you have received.

Pokemon API

// fetch the first pokemon
fetch("https://pokeapi.co/api/v2/pokemon/1/");

Trivia API

// fetch 10 random questions
fetch("https://opentdb.com/api.php?amount=10");

Dad Jokes API

// fetch a dad joke
fetch("https://icanhazdadjoke.com/", {
  headers: { accept: "application/json" },
});

Dictionary API

// fetch the definition of the word "hello" in British English (other languages available in the docs)
fetch(`https://api.dictionaryapi.dev/api/v2/entries/en_GB/hello`);

Step 2 - Break down the problem (20 - 30 mins)

Now that you have an understanding of what data you're working with and have come up with an idea of what you could achieve, break down the problem into smaller chunks. Keep breaking the problem down until you can translate your plan into code. You should dream big, break it down, and start small. If your plan turns out to be overly ambitious, then be smart and reign it in. If you've been too conservative, try and push yourself.

Step 3 - Build (The rest of the day!)

Translate your plan into code, and turn your ideas into reality. Enjoy!

soc-w2d5_fetch-hackathon-dadjokes's People

Contributors

robertmaksymow avatar

Watchers

 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.