Skip to content

Instantly share code, notes, and snippets.

@kevincolyer
Created April 24, 2013 13:51
Show Gist options
  • Save kevincolyer/5452267 to your computer and use it in GitHub Desktop.
Save kevincolyer/5452267 to your computer and use it in GitHub Desktop.
Template::Toolkit content for Perlanet RSS aggregator. Uses HTML::Scrubber plugin for TT to defang and normalise the typography of the feeds that it aggregates.
<div class="span-17 colborder" id="content" >
[% USE Filter.HTMLScrubber %]
[% FOREACH entry IN feed.entries %]
<h2 class="loud alt"><a href="[% entry.link | url | html %]">[% entry.title | html %]</h2></a>
<div class="alt">
[% entry.content.body
| html_scrubber(['-span','+p','+h3','+h4','+ol','+ul','+li','+strong','+em','-style','-script', '-iframe'])
| remove('style=".*?"' )
| remove('class=".*?"' )
| replace( '<img\s', '<img class="right" width="50%" ' )
| replace( '<p', '<p class="alt"' )
| remove('<img\sclass="right"\swidth="50%"\ssrc="http:\/\/podcastpickle.com\/\.assets.*?>' )
| remove('<img\sclass="right"\swidth="50%"\ssrc="http:\/\/assets.*?>' )
| remove('<img\sclass="right"\swidth="50%"\ssrc="http:\/\/feeds.feedburner.com.*?>' )
| remove('<img\sclass="right"\swidth="50%"\ssrc="http:\/\/www\.podcastalley\.com\/images\/podcastalley_icon.*?>' )
%]
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment