Fetching blogger posts using ajax.
For my showcase webpage, I wanted to show some of my blog posts as a demo. Now getting hold of rss-content is fairly easy in an rss-reader; but as JavaScript objects – not so much. I came across different pieces and put them together in a solution that gave me a limited number of blog posts as JavaScript objects using ajax and the blogger API. In the following snippet, I fetch the data using ajax and handle the response building an array of blog posts. Please see my inline comments... var customShapes = []; // First I need a container holding the data in a structured way. As I render the content, I traverse through the array handling each object var blogPosts = []; ... // As the query will change in different scenarios I keep part of the query string as an argument in the function call. loadBlogPostAndRender('alt=json-in-script&start-index=1'); ... ... function loadBlogPostAndRender(posts) { $.ajax({ url: 'http://www.someBloggerBlogUrl/feeds/p...