Skip to content

Instantly share code, notes, and snippets.

@btrott btrott/gist:358553
Created Apr 7, 2010

Embed
What would you like to do?
Sample code for embedding TypePad blog posts in a page
<ul id="blog-widget"></ul>
<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 = '6a00d83455876069e200d83455876369e2';
$( '#blog-widget' ).ready( function() {
$.getJSON(
'http://api.typepad.com/blogs/' + blogId + '/post-assets/@published/@recent.js?callback=?',
{ 'max-results': 5 },
function( data ) {
var ul = $( '#blog-widget' );
for ( var i = 0, len = data.entries.length; i < len; i++ ) {
ul.append( '<li><a href="' + data.entries[ i ].permalinkUrl + '">' + data.entries[ i ].title + '</a></li>' );
}
}
);
} );
</script>
@briannamewborn

This comment has been minimized.

Copy link

briannamewborn commented Nov 27, 2010

Ben, is there a way to use code similar to this to only pull an image from each of these 5 most recent posts?

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.