Search and Replace in Article Text

I’m looking for a way to automatically do some simple search and replace within the article content in some of my feeds, either with string matching or with regular expressions.

Is there a feature in tt-rss that will let me do this? If not, is there a plugin?

I’m not looking for something along the lines of Feediron. I don’t need to try to get the full feeds from the original website. I just need to automatically make a few small alterations to the incoming content.

I used feediron before the PDO migration. After, I just added new filters to af_comics on my local install for the sites I wanted extra filtering and downloads for.

It is manually adjusting the php, I didn’t add a gui hook or anything. It’s a decent starting place at least. It demonstrates pulling the page, getting info from it, and updating the content of the article at least. I added more xpath filtering to some from that as well. It should definitely be a starting point to what you want I’d think.

Easily done with a filter plugin hook.

Do you have any experience with writing PHP? I can walk you through it if you do.

e: Fox has a respository of sample plugins you can also take a look at.

there’s even an example filter plugin: https://git.tt-rss.org/fox/tt-rss-samples/src/master/example-plugins/example_filter/init.php

use preg_replace() on $article[“content”] and you’re done, op.

e: actually my bad, that one uses a different hook. i think plugins/auto_assign_labels would be a better starting point, it’s a basic article filter.

I’ve been looking over these links, and they seem promising. I have some experience with PHP and should be able to put something together, but I can’t find much documentation for plugin development. Is there an online tutorial or API I can consult?

Pretty much roll up your sleeves and get your hands dirty (i.e. go through existing code and figure it out).

Basically the TT-RSS core calls a particular plugin hook (see the pluginhost.php file for all the hooks). It “calls” each hook in a foreach loop. So a plugin registers that it wants to use, for example, HOOK_ARTICLE_FILTER; when TT-RSS gets to that point it runs through each plugin that registered HOOK_ARTICLE_FILTER and calls the hook_article_filter method inside that plugin’s class. The plugin is expected to return its desired results. In your case a search/replace for words in $article['content'].