Skip to content

Instantly share code, notes, and snippets.

@eknown
Created February 11, 2015 22:17
Show Gist options
  • Save eknown/75d79dcfeea3ca3592da to your computer and use it in GitHub Desktop.
Save eknown/75d79dcfeea3ca3592da to your computer and use it in GitHub Desktop.
Simple Dribbble API v1 Use Case
<script type='text/javascript'>
$(function() {
$.getJSON('https://api.dribbble.com/v1/users/USERNAME/shots?access_token=TOKEN&callback=?', function(resp) {
if (resp.data.length > 0) {
$.each(resp.data.reverse(), function(i, val) {
$('#dribbble').prepend(
'<li class="box"><img src="'+val.images.normal+'" /><h2>'+val.title+'</h2><p><a href="'+val.html_url+'">original post &rarr;</a></p></li>'
);
});
}
else {
$('#dribbble').append('<li>No shots.</li>');
}
});
});
</script>
<ul id="dribbble"></ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment