Linked: JSON feeds with Movable Type
This is Walt Grayson’s Movable Type template for generating a JSON feed of your blog posts. When I started publishing a JSON feed a couple months ago, I employed John Gruber’s glue trick to stitch entries together in a beautiful (and valid) way. Walt’s template employs a more elegant approach using the __last__ loop meta variable. Excellent idea.
A valid JSON feed also requires certain characters to be escaped. Walt’s script uses Gruber’s EscapeForJSON Plugin to accomplish this (escape_for_json). Newer versions of Movable Type ship with an encode_json tag modifier which could presumably be used instead.