Inspired by @veltman.
| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <style> | |
| body { | |
| padding: 2em; | |
| text-align: center; | |
| } | |
| </style> | |
| <body> | |
| <img src="box.jpg"> | |
| </body> | |
| <script> | |
| var user = 'tophtucker'; | |
| fetch('https://api.github.com/users/' + user + '/gists').then(function(response) { | |
| return response.ok ? response.text() : Promise.reject(response.status); | |
| }).then(function(text) { | |
| var gists = JSON.parse(text); | |
| window.location = 'http://bl.ocks.org/' + user + '/' + gists[Math.floor(Math.random() * gists.length)].id; | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
