Viestit paikassa Tiny Tiny RSS Community Forums

How about a hook for filtering $articles in FeedParser?

6. kesäkuuta 2014 klo 10.54
Sijainti: Keskustelupalstat: Tiny Tiny RSS Community Forums
Avainsanat: Tiny Tiny RSS

I used to get so many old videos as reruns from Youtube feeds that I got fed up with it and made these changes to init() in classes/feedparser.php (added lines prefixed with ’+’):

foreach ($articles as $article) {
+    $ju_article = new FeedItem_Atom($article, $this->doc, $this->xpath);
+    if ($ju_article->get_date() < strtotime("-14 days")) continue;
+
array_push($this->items, new FeedItem_Atom($article, $this->doc, $this->xpath));
}

(And the same logic for each feed type.)

This seems to work as I like, forcibly dropping everything older than two weeks (I generally don’t care for old content). However, as it is a core change, I’ll have to reimplement it each time TTRSS is updated. Any chance of getting a hook in there somewhere (perhaps operating on $articles prior to that foreach), to do this type of prefiltering in a plugin?

Vastaa viestiin sen kontekstissa (Tiny Tiny RSS Community Forums)