Mark articles needing subscription as read

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
kaistian
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 07 Feb 2015, 14:01

Mark articles needing subscription as read

Postby kaistian » 14 Jul 2015, 18:53

I have a feed, http://www.rb.no/service/rss, and to read some of the articles a subscription required.
I would like to automatically mark them as read.

The feed has a field "<api:subscription>true</api:subscription>" on articles that need subscription and false on the others:

Code: Select all

    <item>
      <title>Omkamp om nasjonalpark</title>
      <link>http://www.rb.no/nyheter/enebakk/miljovern/omkamp-om-nasjonalpark/s/5-43-103401</link>
      <description><![CDATA[ENEBAKK: Oslo-politikerne og Østmarkas venner vil ha nasjonalpark i Enebakk. Politikerne i Enebakk er skeptiske.]]></description>
      <pubDate>Tue, 14 Jul 2015 11:48:03 +0200</pubDate>
      <api:modifiedDate>Tue, 14 Jul 2015 11:48:03 +0200</api:modifiedDate>
      <guid isPermaLink="false">5-43-103401</guid>
      <dc:creator>Torstein Throndsen</dc:creator>
      <api:subscription>true</api:subscription>
    </item>


Is it possible in ttrss to use <api:subscription> to mark them as read?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Mark articles needing subscription as read

Postby fox » 14 Jul 2015, 19:06

entry DOMNode can't be accessed by filter plugins so i'm afraid you can't do it in a straightforward way. i can probably easily add this, it seems a useful thing to have.

there's also a really convoluted workaround of adding a feed_fetched hook, parsing the XML, filtering out item elements using xpath and recreating the xml afterwards but i wouldn't recommend doing this.

e: oh there's feed_parsed hook which will give you a DOMDocument which you can easily xpath to your liking so i guess you can try that.

JustAMacUser
Bear Rating Overlord
Bear Rating Overlord
Posts: 373
Joined: 20 Aug 2013, 23:13

Re: Mark articles needing subscription as read

Postby JustAMacUser » 14 Jul 2015, 19:08

I think you could use HOOK_FEED_FETCH with a plugin to remove those entries before TT-RSS parses the feed for articles.

If you parse it with DOMXPath by adding the api name space you could pretty easily remove the items.

e: Looks like fox already address it. :D

kaistian
Bear Rating Trainee
Bear Rating Trainee
Posts: 9
Joined: 07 Feb 2015, 14:01

Re: Mark articles needing subscription as read

Postby kaistian » 15 Jul 2015, 17:46

Thanks, I'll look into solving it with a plugin.

In the meantime I have made a little python script that uses the api and marks the articles as read.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 8 guests