RSS Feed for Trackbacks

| 1 TrackBack

After creating an RSS feed for new comments, I decided to create an RSS feed for trackback pings as well. Using my RSS comments feed as a basis, I wrote the following template for trackbacks:

<?xml version="1.0" encoding="<$MTPublishCharset$>"?>
<rss version="2.0">
  <channel>
    <title><$MTBlogName remove_html="1" encode_html="1"$>: Trackback</title>
    <link><$MTBlogURL$></link>
    <description>Latest trackbacks for <$MTBlogName remove_html="1" encode_html="1"$></description>
    <language>en-us</language>
    <lastBuildDate><MTPings lastn="1"><$MTPingDate language="en" format="%a, %d %b %Y %H:%M:%S"$> <$MTBlogTimezone no_colon="1"$></MTPings></lastBuildDate>
    <generator>http://www.movabletype.org/?v=<$MTVersion$></generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
<MTPings lastn="20" sort_order="descend">
    <item>
      <title>Trackback: &quot;<$MTPingTitle remove_html="1" encode_html="1"$>&quot;</title>
      <link><$MTPingURL$></link>
      <description>&lt;strong&gt;Excerpt:&lt;/strong&gt; <$MTPingExcerpt remove_html="1" encode_html="1"$>&lt;br /&gt;
      &lt;strong&gt;Weblog:&lt;/strong&gt; <$MTPingBlogName remove_html="1" encode_html="1"$>&lt;br /&gt;
      &lt;strong&gt;Tracked:&lt;/strong&gt; <$MTPingDate language="en" format="%B %d, %Y %I:%M %p"$></description>
      <guid isPermaLink="false">tbping<$MTPingID zero_pad="6"$>@<$MTBlogURL$></guid>
      <pubDate><$MTPingDate language="en" format="%a, %d %b %Y %H:%M:%S"$> <$MTBlogTimezone no_colon="1"$></pubDate>
    </item>
</MTPings>
  </channel>
</rss>

If you would like to use this template to create your own trackback RSS feed: Create a new index template, give it an output file name like "trackbacks.xml", and copy the above code into the template. Save the template then rebuild.

Update 13-May-2004: RSS Trackback Feed template updated:

  • encode_xml attributes replaced with encode_html attributes
  • remove_html and encode_html attributes added to MTBlogName tags in channel title and description elements
  • language="en" attribute added to date tags
  • lastBuildDate element changed from date of rebuild to date of last trackback
  • pubDate element added - shows last rebuild date
  • Text of generator element changed
  • docs element added
  • remove_html attribute added to MTPingTitle, MTPingExcerpt, and MTPingBlogName tags in item description element
  • <b> tags replaced with <strong> tags in item description element

Update 10-Jun-2004: RSS Trackback Feed template updated again:

  • pubDate element removed from <channel> - rebuilding feed shouldn't make feed appear changed unless something really has
  • ttl element removed - not necessary

1 TrackBack

Wow, the sound of my own hand slapping my forehead with a loud, "duh!". The TweezerMan (not sure if I want to know the story behind that name) has provided easy to copy templates for creating RSS Feeds for Trackbacks... Read More