<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Raymond Law: Using FeedBurner with Typo</title>
    <link>http://blog.rayvinly.com/articles/2007/07/12/using-feedburner-with-typo</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Using FeedBurner with Typo</title>
      <description>&lt;p&gt;You want to run your &lt;a href="http://typosphere.org/"&gt;Typo&lt;/a&gt; blog feed through &lt;a href="http://feedburner.com"&gt;FeedBurner&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;First, go to your blog&amp;#8217;s admin page and click on the &lt;span class="caps"&gt;DESIGN&lt;/span&gt;  tab.  Drag the &lt;span class="caps"&gt;XML&lt;/span&gt; Syndication item from Available Items to Active Sidebar items.  Choose either &lt;span class="caps"&gt;RSS 2&lt;/span&gt;.0 or Atom 1.0 according to what you choose when setting up FeedBurner.  I selected Articles only because that&amp;#8217;s what I want.  Remember to click on the Publish changes button.&lt;/p&gt;


	&lt;p&gt;In your Typo app, modify &lt;code&gt;vendor/plugins/xml_sidebar/views/content.rhtml&lt;/code&gt; to the following:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;  &lt;span class="punct"&gt;&amp;lt;%&lt;/span&gt; &lt;span class="keyword"&gt;if&lt;/span&gt; &lt;span class="ident"&gt;articles&lt;/span&gt; &lt;span class="punct"&gt;-%&amp;gt;&lt;/span&gt;&lt;span class="string"&gt;
  &amp;lt;li&lt;/span&gt;&lt;span class="punct"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="ident"&gt;a&lt;/span&gt; &lt;span class="ident"&gt;href&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;&amp;lt;Your FeedBurner URL&amp;gt;&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="ident"&gt;rel&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;alternate&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="ident"&gt;type&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;application/rss+xml&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="ident"&gt;img&lt;/span&gt; &lt;span class="ident"&gt;src&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;http://www.feedburner.com/fb/images/pub/feed-icon16x16.png&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="ident"&gt;alt&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt; &lt;span class="ident"&gt;style&lt;/span&gt;&lt;span class="punct"&gt;=&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;vertical-align:middle;border:0&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="regex"&gt;a&amp;gt;&amp;amp;nbsp;&amp;lt;a href=&amp;quot;&amp;lt;Your FeedBurner URL&amp;gt;&amp;quot; rel=&amp;quot;alternate&amp;quot; type=&amp;quot;application&lt;/span&gt;&lt;span class="punct"&gt;/&lt;/span&gt;&lt;span class="ident"&gt;rss&lt;/span&gt;&lt;span class="punct"&gt;+&lt;/span&gt;&lt;span class="ident"&gt;xml&lt;/span&gt;&lt;span class="punct"&gt;&amp;quot;&lt;/span&gt;&lt;span class="string"&gt;&amp;gt;Subscribe&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;% end %&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Of course you can use whatever image you like.  The one shown above is linked to FeedBurner&amp;#8217;s standard feed icon.  You can use FeedBurner&amp;#8217;s Chicklet Chooser to get the &lt;span class="caps"&gt;HTML&lt;/span&gt; code to paste into &lt;code&gt;content.rhtml&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Another way is to set up a redirect using mod_rewrite in your Apache configuration (thanks to &lt;a href="http://www.robbyonrails.com/articles/2006/09/08/apache-typo-and-feedburner"&gt;Robby&lt;/a&gt;):&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;  # Redirect typo feeds to FeedBurner
  RewriteCond %{HTTP_USER_AGENT} !^FeedBurner.*$
  RewriteRule /xml/(atom|rss|rss20)/feed.xml$ http://feeds.feedburner.com/rayvinly [R=temp,L]&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;In both cases, make sure you go to your blog admin&amp;#8217;s &lt;span class="caps"&gt;SETTINGS&lt;/span&gt; tab, scroll to the bottom and click on Empty Fragment Cache.&lt;/p&gt;


	&lt;p&gt;Now go to your blog page and click on that Subscribe link to see your FeedBurner feed.&lt;/p&gt;</description>
      <pubDate>Thu, 12 Jul 2007 13:42:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:e4b30987-ae61-4315-8e41-c17fb90c30ff</guid>
      <author>Raymond Law</author>
      <link>http://blog.rayvinly.com/articles/2007/07/12/using-feedburner-with-typo</link>
      <category>Ruby on Rails</category>
      <category>typo</category>
      <category>feedburner</category>
      <category>ruby</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>apache</category>
      <trackback:ping>http://blog.rayvinly.com/articles/trackback/4</trackback:ping>
    </item>
    <item>
      <title>"Using FeedBurner with Typo" by Piers Cawley</title>
      <description>&lt;p&gt;The trouble with the Apache redirect is that, with edge typo, those feed urls are no longer definitive. The new canonical urls are going to be &lt;a href="http://host/articles.atom" rel="nofollow"&gt;http://host/articles.atom&lt;/a&gt; and &lt;a href="http://host/articles.rss.&lt;/p" rel="nofollow"&gt;http://host/articles.rss.&lt;/a&gt;&lt;/p&gt;&gt;


	&lt;p&gt;A better way would probably be to pull out the feed URL generation stuff from ContentHelper#page_header, add a &lt;code&gt;feedburner_url&lt;/code&gt; field to the blog settings and proceed from there.&lt;/p&gt;


	&lt;p&gt;Patches welcome :)&lt;/p&gt;</description>
      <pubDate>Fri, 13 Jul 2007 06:10:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:1ff7451b-daee-483e-949e-bafadeee55a9</guid>
      <link>http://blog.rayvinly.com/articles/2007/07/12/using-feedburner-with-typo#comment-1</link>
    </item>
  </channel>
</rss>
