Use the github API to get a list of gists from your github account and print them in HTML.
Forked from Kamil Slowikowski's Pen List of github gists.
A Pen by Lanorise Cainion on CodePen.
Use the github API to get a list of gists from your github account and print them in HTML.
Forked from Kamil Slowikowski's Pen List of github gists.
A Pen by Lanorise Cainion on CodePen.
| $.getJSON('https://api.github.com/users/slowkow/gists', function(data) { | |
| var items = [] | |
| $.each(data, function(i, val) { | |
| items.push( | |
| "<li id='" + i + "'>" + | |
| "<a href='" + val.url + "'>" + | |
| val.description + | |
| "</a>" + | |
| " (" + val.files[Object.keys(val.files)[0]].language + ")" + | |
| '</li>' | |
| ) | |
| }) | |
| $("<ul/>", { | |
| "class": "gists", | |
| "html": items.join("") | |
| }).appendTo("body") | |
| }) |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |