Excerpt filters and feedburner.

Lech unattended at gmail.com
Sat Jun 14 03:39:21 EST 2008


On 6/13/08, Sam Ruby <rubys at intertwingly.net> wrote:
 > On Fri, Jun 13, 2008 at 8:55 AM, Lech <unattended at gmail.com> wrote:
 >  > On 6/13/08, Sam Ruby <rubys at intertwingly.net> wrote:
 >  >> On Thu, Jun 12, 2008 at 8:11 PM, Lech <unattended at gmail.com> wrote:
 >  >>  > So I'm still trying to wrap my head around python a bit but have
 >  >>  > managed to dig around and get some of the filters working after
 >  >>  > looking through the examples (why are some of these in the /examples/
 >  >>  > directory?). The only two I'm having issues with at the moment are SED
 >  >>  > and Excerpt filters.
 >  >>
 >  >> Not all of the filters were created by the same person, so there may
 >  >>  not always be consistency in where they were placed.  The example
 >  >>  filters tend not to be ones that can be used "as is" but require
 >  >>  tailoring.
 >  >
 >  > Ahh, alright. I was just curious why they were split up. Initially it
 >  > seems like they serve as some type of secondary (don't move these or
 >  > you'll destroy the world) type of filters. Maybe just moving them into
 >  > the main filters directory and sticking a readme file warning of
 >  > needed tweaking would clear this up in the future. No big deal though.
 >  >
 >  >>  > From what I can tell, the SED filters are pretty straight forward
 >  >>  > regexp. However it seems that the regexp used is a bit outdated for
 >  >>  > the feedburner advert filter and I can't seem to be able to scrub the
 >  >>  > "digg this" and other images properly out of feeds. I'll play around
 >  >>  > with this a little more on my own, but if anyone already has a
 >  >>  > solution an update would be awesome.
 >  >>
 >  >> Example feed with the data you want scrubbed?
 >  >
 >  > I've been toying around and attempting to scrub the "feedflare" (digg
 >  > this/reddit) adverts from a friends feedburner feed located here:
 >  > http://feeds.feedburner.com/Bdetails using the feedburner.sed filter.
 >  > I've tried a number of methods but nothing seems to work.
 >
 >
 > One thing that may not be obvious is that filters are run on the
 >  sanitized version of the feed.
 >
 >  You can see what the entries look like by either looking in your cache
 >  directory or by running a test program provided with Venus:
 >
 >  python tests/reconstitute.py http://feeds.feedburner.com/Bdetails
 >
 >  At the moment, I'm puzzled as I don't see the feedflare information in
 >  the output of that program, and don't recall anything I did on my
 >  installation which would make it automatically get removed.  I will
 >  continue to look at this.


Alright, that is very strange indeed. I reconstituted the feed as
 prescribed on this end, and you're right. The feedflare doesn't show
 up anywhere so that confirms what you're seeing. But if you do a
 view-source: in your browser of the feed it displays as
 <feedburner:feedFlare href="..." src="..."">advert
 text</feedburner:feedFlare> which then somehow translates into

 <div class="feedflare">
 <a href="http://feeds.feedburner.com/~f/user?a=gArBG"><img border="0"
 src="http://feeds.feedburner.com/~f/Bdetails?i=gArBG"/></a>
 [...]
 </div>

 Which all winds back up in the final output as seen above. And if you
 look at the cache objects for items you know to be pulled from
 feedburner you'll see the same. It's making it hard to intercept this
 particular markup.


 >
 >  >>  > Also, how exactly do I utilize and properly the excerpt.py filter
 >  >>  > within my configs to strip images down?
 >  >>
 >  >> Add something like the following to your config.ini:
 >  >>
 >  >>  http://www.intertwingly.net/code/venus/tests/data/filter/excerpt-images.ini
 >  >>
 >  >>  And then try the 'mobile' theme provided with Venus as a starting point.
 >  >
 >  > Hmm, odd. I've been using a copy of the classic_fancy theme and have
 >  > exactly that in my config but it's not working as expected either. :F
 >  > and debug isn't showing me anything out of the ordinary when I run
 >  > Venus.
 >
 >
 > What the excerpt filter does is put the data into the cached copy of
 >  the feed, and by default it does so by putting this into a new element
 >  which htmltmpl type templates don't know how to look for.  You can
 >  specify a 'target=atom:content' parameter to excerpt which will cause
 >  it to overwrite the content of the entry and htmltmpl style templates
 >  do know how to pick that element up.


OK, so does this mean I need to also modify the htmltmpl template to
 expect this parameter, or once the target is specified it will detect
 everything without any changes? I'm starting to wonder if the SED
 issue might also revolve around using htmltmpl templates which
 probably means I should have first tried using the mobile theme. Is
 there also any target list available out there for me to mess around
 with?


 -L


More information about the devel mailing list