k0ral / imm

Execute arbitrary actions for each unread element of RSS/Atom feeds
http://hackage.haskell.org/package/imm
Creative Commons Zero v1.0 Universal
16 stars 4 forks source link

add filters #9

Closed legrostdg closed 7 years ago

legrostdg commented 7 years ago

It would be great to be able to use some kind of "filter". A filter would be configurable for each feed, and it would turn a specific webpage to a rss/atom feed, which would then be processed by imm internals.

I may help if the feeds were specified in the configuration file (and not the db), to be able to add haskell filters.

k0ral commented 7 years ago

I guess it's not too much effort to add an intermediate conduit between the input HTML and the RSS/Atom parser, as a placeholder for your filter. I'll have a look and come back to you.

legrostdg commented 7 years ago

Great!

I don't get how you could apply a specific filter to a specific feed, if you have the feeds specified in the db. Do you have an idea in mind?

k0ral commented 7 years ago

The behavior can be customized through the DSL/interpreter pattern (cf this module for more information). I can see at least 2 solutions:

legrostdg commented 7 years ago

OK, I did not think about these two possibilities. Maybe the first one would be easier? It would be great to have some kind of helpers.

k0ral commented 7 years ago

Actually, after second though, I'm creating a new XML parser interpreter, where your filter will fit nicely.

k0ral commented 7 years ago

Implemented in dcc7021ea2d136d6149c8383027a34f2bfa9c1a4. Could you please check out master branch and validate that it meets your requirements, before I make an official release out of it ?

legrostdg commented 7 years ago

Could you update the example in Imm.Boot to use coXmlParser? It would help there was some logic to select some different filters based on the uri.

legrostdg commented 7 years ago

It seems great! Thanks a lot, I guess I'll obsolete perfeed and use imm soon :-).

k0ral commented 7 years ago

Updated example in Imm.Boot.

k0ral commented 7 years ago

Integrated in release 1.2.0.0 .