[TxMt] automated RSS feeds with TextMate
Oliver Taylor
ollieman at gmail.com
Sun Mar 26 09:48:51 UTC 2006
I use this to create the feeds for ollieman.net. I thought you guys
might like this...
You'll want to start out with a valid RSS2 feed like this:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title></title>
<link></link>
<language>en-us</language>
<description></description>
</channel>
</rss>
Now to the real fun; it's just a snippet but it makes hand-coding RSS
feeds a breeze. Here it is:
<item>
<title>$1</title>
<description><![CDATA[
$2
<a href="$5">Read more</a>
]]></description>
<pubDate>${3:`date +%a,\ %d\ %b\ %Y\ %H:%M:%S\ %Z`}</pubDate>
<author>${4:Oliver Taylor} nospam at example.com</author>
<guid isPermaLink="true">${5:http://ollieman.net/$6}</guid>
<link>$5</link>
<category>$7</category>
</item>
The only thing of real note here is getting the pubDate correct. If
you want it to insert GMT instead of your local time you'll have to
tweak that.
Lastly, make sure to set the scope to text.xml and you're all set.
That's it! 1,2,3-easy RSS feed.
More information about the textmate
mailing list