Skip to content

Instantly share code, notes, and snippets.

@grahamjenson
Last active January 1, 2016 09:49
Show Gist options
  • Select an option

  • Save grahamjenson/8127709 to your computer and use it in GitHub Desktop.

Select an option

Save grahamjenson/8127709 to your computer and use it in GitHub Desktop.

Testing out the gist api from github with bostocks bl.ocks v1

This is not helping

<html>
<meta charset="utf-8">
<body>
<div id='gists'> </div>
<script src='http://code.jquery.com/jquery-2.0.3.js'></script>
<script src="http://coffeescript.org/extras/coffee-script.js"></script>
<script type="text/coffeescript">
console.log 'starting x'
$.when($.get('https://api.github.com/users/grahamjenson/gists'))
.done((gists) ->
console.log gists
for gist in gists
if gist.files['thumbnail.png']
thumb = gist.files['thumbnail.png']
console.log(thumb)
$('body').append("<img src='#{thumb.raw_url}'></img>")
else
console.log 'no thumbnail'
)
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment