Content Management
RSS Ads in Movable Type
Freshness Warning
This blog post is over 21 years old. It's possible that the information you read below isn't current and the links no longer work.
24 Dec 2002
I’ve added a short ad for my consulting services to the RSS feed for Simplelinks. The problem with putting persistant content in RSS is that many news aggregators only show an item once unless it changes.
So your persistant item has to change regularly, but not too regularly. If the same item appears in the feed every day, people may get irritated and stop reading your feed. If the item only changes once a month, then the ad won’t have much impact.
I settled on changing the ad weekly. Then I had to figure out how to have content automatically changes once a week. My plan was to have link element use a query string that would be unique each week. Using the year and the week number for the current date would work fine.
MT’s date formatting commands will let me insert the day number (the tag <$MTDate format="%j"$>
inserts 177), but not the week number. I considered writing a plugin to add a week number format command to MT (and I still might), but for a quick and dirty way of doing things I turned to the Regex plugin to convert the day number into a week number.
Here’s what ended up in my template, right after the final </MTEntries>
tag.
<MTAddRegex name="weeknum"> s|(\d+)|int($1/7 + .9999)|e</MTAddRegex> <item> <title>Kalsey Consulting Group :: Web Sites With Business Sense</title> <description>Simplelinks is a product of Kalsey Consulting Group. We build Web sites that solve real business problems. To find out how we can help your business, ask for a free quote at <a href="http://kalsey.com?<MTDate format="%Y">- <MTDate format="%j" regex="weeknum"> ">http://www.kalsey.com/</a></description> <link>http://kalsey.com?<MTDate format="%Y">- <MTDate format="%j" regex="weeknum"></link> </item>