Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution order/future works #120

Open
dugite-code opened this issue Feb 4, 2019 · 4 comments
Open

Execution order/future works #120

dugite-code opened this issue Feb 4, 2019 · 4 comments
Assignees
Milestone

Comments

@dugite-code
Copy link
Contributor

dugite-code commented Feb 4, 2019

Future Discussion

Filters could use an Observer pattern to make extending and modifying FeedIron a simpler task. This would Also free up Filters so they can be better mixed and matched.

THIS WOULD BE A BREAKING CHANGE

I'm proposing adding an execution order to filters. I feel this makes filter a bit more readable not to mention powerful. For example you could have a "processed" variable so an option could choose to work on the original html or the processed html passed from previous operations.

"somesite.com":{
	"1": {
		"type": "readability"
	},
	"2": {
		"type": "insert",
		"string": "<br>"
	},
	"3": {
		"type": "xpath",
		"processed": false,
		"xpath": "article",
		"cleanup": "h2"
	},
	"join_element": "<p>",
	"cleanup": ["~<script([^<]|<(?!/script))*</script>~msi"],
	"debug": true
}
dugite-code added a commit that referenced this issue Feb 28, 2019
#120
#5
Added Helper functions
@dugite-code dugite-code changed the title Move Filters to separate files Switch Filters to an Observer Pattern Mar 7, 2019
@dugite-code dugite-code self-assigned this Mar 7, 2019
@dugite-code dugite-code added this to the 1.3.0 milestone Mar 7, 2019
@dugite-code dugite-code pinned this issue Mar 7, 2019
@dugite-code dugite-code modified the milestones: 1.3.0, 2.0.0 Mar 7, 2019
@dugite-code
Copy link
Contributor Author

On Hold till after initial Module work is completed

@dugite-code
Copy link
Contributor Author

Now that the Initial initial Module work is completed execution order work is underway. Replacing the current module loading with an Observer Pattern can be introduced at a later date

@dugite-code dugite-code changed the title Switch Filters to an Observer Pattern Execution order/future works Dec 19, 2019
@aparhatus
Copy link

I was just about to ask if this was possible, when I came upon this issue. This would be an excellent addition.

Is it possible to do anything similar currently? My main wish is to use a different join_element for different elements, so I tried to use multiple xpath filters (similar to your example, not by using an array), but I couldn't get it working.

@dugite-code
Copy link
Contributor Author

I haven't merged this into master yet as it's a general work in progress and has several issues to sort out. Unfortunately I've not had a much free time recently to push this forward.

You can see my work in the modular-dev branch: https://github.com/feediron/ttrss_plugin-feediron/blob/modular-dev/init.php#L534

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants