Skip to content

Instantly share code, notes, and snippets.

@jim
Created November 8, 2010 18:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jim/668086 to your computer and use it in GitHub Desktop.
Save jim/668086 to your computer and use it in GitHub Desktop.
Rough example for calling Dribbble API with JavaScript
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>untitled</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="Jim Benton">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function() {
$.getJSON("http://dribbble.com/theskywatcher/shots.json?callback=?", function(data){
$.each(data.shots, function(i,shot){
var title = $('<h1/>').text(shot.title);
var image = $('<img/>').attr('src', shot.image_teaser_url);
var p = $('<p/>').append(title, image);
$('body').append(p);
});
});
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment