Tiny Tiny RSS: Community

Best way to include additional namespace:elements


#1

I read soylentnews (https://soylentnews.org/index.rss); which was forked off old slashcode. Based in the roots of ./ it has a “from the __ dept.” that is in the rss feed under a custom namespace (<slash:department />).

E.g. article title=Meta: Site Certificates Updated
slash:department=certs-are-not-just-a-breath-mint

I could write a plugin to filter the feed or articles and copy the dept. into the title, or at the top of the contents, or as a tag, etc… Although since “dept” is custom 1-off, it doesn’t seem like a tag would be best since filtering on it would just give 1 article.

But I was wondering if there wasn’t something already in place for this sort of thing? Like a source-to-target map for feed element to tt-rss objects. I looked at rssutils and didn’t see anything obvious besides maybe writing a plugin.

Has anyone needed anything like this before? Suggestions?


R


#2

Perhaps I’m missing something but isn’t that namespace already included in FeedParser? In such cases you’d access the element using libxml as follows:

$xpath->query("slash:department");

Or are you trying to make use of these elements while using the user-defined filters configured from the frontend? In that case, these elements are not available as TT-RSS only pulls in what it needs to populate the database. But there are plenty of hooks throughout the process to manipulate things. HOOK_FEED_FETCHED, HOOK_FETCH_FEED, HOOK_FEED_PARSED. That last one gives you the actual FeedParser object, which would probably work well.


#3

like @JustAMacUser said above you should be able to write a very simple plugin sitting on one of the hooks which would add this field to title or somewhere else to be later stored in the database

technically you could even extend the schema and display this custom field in the UI somewhere but that would be way too much effort, i think, and possibly require core modifications

this kind of stuff would be possible if tt-rss used some kind of ORM but it doesn’t so it’s not :slight_smile:


#4

I just mean to display it, so most likely modifying the title or article content. Good to know it should be simple to access. Like fox said, there’s no ORM so no mapper. Just a simple plugin would work.

Thx all.