to_analyse

example to analise

by cespinoza

HTML

<!DOCTYPE html>
<html>
<body>

<h2 id="title"># Gif</h2>
<img id="preview_gif" src="" alt="" style="width:220px;height:164px;">


</body>
</html>

JavaScript

var apikey = "LIVDSRZULELA";
var lmt = 1;
var search_term = "angry";
var search_url = "https://g.tenor.com/v1/search?q=" +
  search_term + "&key=" +
  apikey + "&limit=" + lmt;

fetch(search_url)
	.then(response => response.json())
	.then(data => {
    document.getElementById("title").innerHTML = search_term;
    document.getElementById("preview_gif").src = data["results"][0]["media"][0]["nanogif"]["url"]
  });