Planet aggregator and embedded videos
I've been trying to get the Planet aggregator to display embedded video on the page in its output. Youtube videos from a Wordpress feed look ok, but <object> tags from my Drupal feed get mangled for some reason.
Here's what I've discovered so far:
First of all, to allow embedded objects to be displayed you need to edit both planet/sanitize.py and planet/feedparser.py, and add 'object', 'media', 'embed' to the acceptable_elements array. That does the trick for youtube videos coming in a Wordpress rss feed (wp-rss2.php), where the content is passed as CDATA inside a <content:encoded> tag.
From Drupal the content is passed in a <description> tag, and at line 905 of Planet's __init__.py is identified as String content and passed to sanitize.HTML. This function then does some funky stuff popping elements onto and off a stack, and messes everything up, moving the object's closing tag up before the <param> tags. With the Wordpress feed the <object> code is inside some kind of array around line 905, so it doesn't get passed through the sanitizor. I've tried commenting line 905 out, to stop it from sanitizing the code. It means that the page just potentially became a crack smoker, but that's life.
- sitapati's blog
- Login or register to post comments




Madhava Gosh I can't help
Madhava Gosh
I can't help you with all that, but I can tell you that since you put the YouTube things on IN.net, it takes forever to load. The text still comes in fine and fast, but I was waiting to see the sidebar and get the addy for this site to give you some props, but I walked away and came back and the thing was still loading and no sign of the sidebar so I googled you instead.
I am on dialup so any video thingy is slow, but this seemed really slow; I don't know if it was actually loading the videos themselves, or just 'hitting the pipe".
planet aggregator
hare krsna,
if you tell me where to download the exact version of planet you're using i'll try to figure out how to make it import object-tags. won't be immediate since perl isn't exactly my favorite programming language, but a good exercise, anyway.
ys phani.
Planet Planet
You can grab it from here: www.planetplanet.org
It's written in Python - if you haven't used python before be aware that whitespace has meaning, so you have to indent statements with the correct amount of spaces or you'll get an error. Thanks for your offer to help.
planet aggregator
but it's working now, isn't it?
(of course i agree with madhava gosh - on dialup it's a looong wait.)
ys phani.