Skip to content

Instantly share code, notes, and snippets.

@btrott
Created June 18, 2010 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save btrott/444317 to your computer and use it in GitHub Desktop.
Save btrott/444317 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html><head>
<meta charset="utf-8">
<title>Gallery</title>
</head><body>
<div id="gallery-widget"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
var blogId = '6a0133f05b13cc970b0134838b98a2970c';
$( document ).ready( function() {
$.getJSON(
'http://api.typepad.com/blogs/' + blogId + '/post-assets/@by-category/Gallery.js?callback=?',
{ 'max-results': 20 },
function( data ) {
$.each( data.entries, function( idx, asset ) {
$.each( asset.embeddedImageLinks, function( idx, link ) {
if ( link.urlTemplate ) {
var src = link.urlTemplate.replace( '{spec}', '320pi' );
var html = '<a href="' + asset.permalinkUrl + '"><img src="' + src + '" /></a>';
$( '#gallery-widget' ).append( html );
}
} );
} );
}
);
} );
</script>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment