Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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
You can’t perform that action at this time.