<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>HTTP</title> <link rel="stylesheet" href="../../node_modules/reveal.js/css/reveal.css"> <link rel="stylesheet" href="../../node_modules/reveal.js/css/theme/black.css"> <!-- Theme used for syntax highlighting of code --> <link rel="stylesheet" href="../../node_modules/reveal.js/lib/css/zenburn.css"> <link rel="stylesheet" href="../../node_modules/@fortawesome/fontawesome-free/css/all.min.css"> <link rel="stylesheet" href="../main.css"> <!-- Printing and PDF exports --> <script> var link = document.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = window.location.search.match( /print-pdf/gi ) ? '../../node_modules/reveal.js/css/print/pdf.css' : '../../node_modules/reveal.js/css/print/paper.css'; document.getElementsByTagName( 'head' )[0].appendChild( link ); </script> </head> <body> <div class="reveal"> <div class="slides"> <section data-markdown="md/http.md" data-separator="^\n\n\n" data-separator-vertical="^\n\n" data-separator-notes="^Note:" data-charset="utf-8"> </section> </div> </div> <!-- script src="../../node_modules/reveal.js/lib/js/head.min.js"></script --> <script src="../../node_modules/reveal.js/js/reveal.js"></script> <script> // More info about config & dependencies: // - https://github.com/hakimel/reveal.js#configuration // - https://github.com/hakimel/reveal.js#dependencies Reveal.initialize({ controls: true, progress: true, history: true, center: false, dependencies: [ { src: '../../node_modules/reveal.js/plugin/markdown/marked.js' }, { src: '../../node_modules/reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); }, callback: function() { Array.prototype.forEach.call(document.querySelectorAll('section > li'), function(ele){ var fragIndex = ele.innerHTML.indexOf("--") if (fragIndex != -1){ ele.innerHTML = ele.innerHTML.replace("--", ""); ele.className = 'fragment'; } }); } }, { src: '../../node_modules/reveal.js/plugin/notes/notes.js', async: true }, { src: '../../node_modules/reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } } ] }); </script> <script> document.addEventListener('DOMContentLoaded', function () { q = "finger guns"; // search query request = new XMLHttpRequest; request.open('GET', 'https://api.giphy.com/v1/gifs/random?api_key=GmPNFEPI5osSNgLf9IcWoq00anejpuQY&tag='+q, true); request.onload = function() { if (request.status >= 200 && request.status < 400){ data = JSON.parse(request.responseText).data.images.original.url; document.getElementById("giphyjson").innerHTML = JSON.stringify(JSON.parse(request.responseText), null, 2); document.getElementById("giphyme").innerHTML = '<center><img src = "'+data+'" title="GIF via Giphy"></center>'; } else { console.log('reached giphy, but API returned an error'); } }; request.onerror = function() { console.log('connection error'); }; request.send(); }); </script> </body> </html>