Page 1 of 1

Plugin to modify RAW RSS before it will be parsed

Posted: 22 Feb 2013, 13:52
by fleg
Hi,

is there a hook to work on the RAW RSS feed before it gets parsed?
I want to filter out some HTML which is in this feed [1] for parser not to complain.
Where can I find all hooks that are available?

Best regards

Fleg

[1] http://www.ibm.com/developerworks/ru/vi ... ed_by=atom

Re: Plugin to modify RAW RSS before it will be parsed

Posted: 22 Feb 2013, 14:07
by fox
You can work on a parsed RSS object with HOOK_FEED_PARSED but I'm not sure if you can modify things. Not on raw XML so far, but it is easily implementable I suppose.

Where can I find all hooks that are available?


classes/pluginhost.php has a complete list near the top.

Edit: Kudos to IBM for publishing broken XML btw.

Re: Plugin to modify RAW RSS before it will be parsed

Posted: 22 Feb 2013, 14:10
by fox
I'm looking through the code and things are a bit complicated by the fact that SimplePie does the actual downloading at the moment.

Re: Plugin to modify RAW RSS before it will be parsed

Posted: 22 Feb 2013, 14:47
by fleg
fox wrote:I'm looking through the code and things are a bit complicated by the fact that SimplePie does the actual downloading at the moment.


Well then I have to write a "middleware" which cleans the IBM feed.
BTW: Shame on them.

Re: Plugin to modify RAW RSS before it will be parsed

Posted: 23 Feb 2013, 18:39
by fox

Re: Plugin to modify RAW RSS before it will be parsed

Posted: 19 Mar 2013, 17:07
by fleg
Thank you fox for implementing the hook.
I've created a small plug-in to clean the IBM feed from the html tags because xmllint plugin was also complaining about the syntax.
Shame on you twice IBM...
http://pastebin.com/ijutLjfN

Re: Plugin to modify RAW RSS before it will be parsed

Posted: 03 Apr 2013, 21:47
by jchristi
After importing over 600 feeds from google reader (yes another immigrant) I've found several with invalid xml, so this is something I'm interested in as well. I'll know more once I go through the feed parsing and plugin code.