Coder Social home page Coder Social logo

fetch-quotes's Introduction

Random Quote Machine

We're going to use JavaScript to make a webpage that displays a random quote. We'll use the built-in fetch method to call an API that will give us quotes.

Getting Started

  • Fork and clone this repository
  • Setup your HTML page, and don't forget to include links to the CSS and JS files!
  • Be creative in your choice of styling. Think about all of those different CSS properties.

Gathering Quotes

There are two possibilities we can use to get random quotes:

  • Random Funny Dev Quotes by StormConsultancy (check out the documentation)
  • Random Famous Quotes by Forismatic (check out the documentation)
// Random Funny Dev Quotes
http://quotes.stormconsultancy.co.uk/random.json
// Random famous quote
https://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=json

Take one of those links and paste it into your browser. Check if you're getting results and see how they are coming back!

Requirements

  • Using HTML, CSS, and JavaScript, create a webpage that displays a random quote on the page when a button is clicked
  • Every time the button is clicked, clear the old quote and replace it with a new random quote.
  • Use the fetch function to obtain a quote from your chosen API.

Bonus!

  • Use the dad joke API.
    • Note that this requires you to send something in the request header!
    • Take a look at the docs and see if you can figure it out!
    • This API also allows you to use images! If you implement this, how will it change your code?

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-quotes's People

Contributors

009kings avatar bhague1281 avatar brandiw avatar geluso avatar taylordarneille 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.