Skip to content

Instantly share code, notes, and snippets.

@abelsan
Created September 29, 2020 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save abelsan/45c22cd4e5917d0a881ac9ecb9628e78 to your computer and use it in GitHub Desktop.
Save abelsan/45c22cd4e5917d0a881ac9ecb9628e78 to your computer and use it in GitHub Desktop.
Giphy starter code
<!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