Created
September 29, 2020 03:01
-
-
Save abelsan/45c22cd4e5917d0a881ac9ecb9628e78 to your computer and use it in GitHub Desktop.
Giphy starter code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<div id="container"></div> | |
<script> | |
var query = 'dog'; | |
var apiKey = '7LzHKvaZaAylJUePuMZS2NnXYVsVgm61'; | |
var giphy = `https://api.giphy.com/v1/gifs/search?api_key=${apiKey}&q=${query}&limit=10&offset=0&rating=G&lang=en` | |
// ------------------------------------ | |
// YOUR CODE | |
// Get handle of div "container" | |
// ------------------------------------ | |
async function fetchGiphy(){ | |
// ------------------------------------ | |
// YOUR CODE | |
// 1 - Use fetch to giphys | |
// 2 - Use await, loop through data | |
// 3 - Write items to console | |
// 4 - Load images on browser | |
// ------------------------------------ | |
} | |
fetchGiphy(); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment