Plugin to modify RAW RSS before it will be parsed

Development-related discussion, including bundled plugins
fleg
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Sep 2011, 00:23

Plugin to modify RAW RSS before it will be parsed

Postby fleg » 22 Feb 2013, 13:52

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

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

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

Postby fox » 22 Feb 2013, 14:07

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.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

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

Postby fox » 22 Feb 2013, 14:10

I'm looking through the code and things are a bit complicated by the fact that SimplePie does the actual downloading at the moment.

fleg
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Sep 2011, 00:23

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

Postby fleg » 22 Feb 2013, 14:47

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.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

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

Postby fox » 23 Feb 2013, 18:39


fleg
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 15 Sep 2011, 00:23

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

Postby fleg » 19 Mar 2013, 17:07

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

jchristi
Bear Rating Trainee
Bear Rating Trainee
Posts: 17
Joined: 03 Apr 2013, 21:18

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

Postby jchristi » 03 Apr 2013, 21:47

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.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests