Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

add filters #9

Closed
legrostdg opened this issue Feb 20, 2017 · 10 comments
Closed

add filters #9

legrostdg opened this issue Feb 20, 2017 · 10 comments

Comments

@legrostdg
Copy link

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
Copy link
Owner

k0ral commented Feb 20, 2017

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
Copy link
Author

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
Copy link
Owner

k0ral commented Feb 21, 2017

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

  • the intermediate conduit can be put in the HTTP interpreter, such that the feed URI can be used to choose a filter: filter :: URI -> Conduit Event m Event
  • the intermediate conduit can be a new standalone interpreter, with access to the DatabaseEntry to choose a filter (which includes URI and even a category name): filter :: DatabaseEntry -> Conduit Event m Event

@legrostdg
Copy link
Author

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
Copy link
Owner

k0ral commented Feb 22, 2017

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

@k0ral
Copy link
Owner

k0ral commented Feb 25, 2017

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

@legrostdg
Copy link
Author

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
Copy link
Author

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

@k0ral
Copy link
Owner

k0ral commented Feb 27, 2017

Updated example in Imm.Boot.

@k0ral
Copy link
Owner

k0ral commented Mar 19, 2017

Integrated in release 1.2.0.0 .

@k0ral k0ral closed this as completed Mar 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants