Plugin to mark articles read/unread

Post plugins and custom CSS snippets here
pcause
Bear Rating Master
Bear Rating Master
Posts: 144
Joined: 23 Aug 2013, 19:52

Plugin to mark articles read/unread

Postby pcause » 04 Apr 2017, 16:02

Mark read / mark unread with enhanced timeframes and search expression matching

**This is alpha code. I have tested on the latest version of tt-rss and with postgresql. I have never tested on mysql but think it will work.**

USE AT YOUR OWN RISK


This plugin is derived from the catchup_feed function of ttrss. It is enhanced in that it allows you to mark items read or unread based on a user specified timeframe. In addition you can specify a search expression, using the same search syntax as tt-rss search (I use the same function) and the mark read/mark unread will apply to only those items that match the regex. Fro example, on a selected feed/category/label you can mark articles newer than 48 hours unread, or mark articles that are older than 2 days and match "google" as read.

Once enabled the plugin will add an item to the actions menu for "Enhanced Mark Read". Select this and you'll get a dialog
that allows you to specify both a number and interval (hours/days/weeks/months) for the mark read/unread of the selected label/category/feed and the search expression (if you are on postgresql). Please remember that the time window specified has different meaning on mark read and mark unread. On mark read, it marks all matching items older than the specified interval as read. On mark unread, it marks all matching items newer than the specified interval as read.

I recommend you try the mark unread on a feed/category with a small number of items that you've just finished reading and has no unread items. Then mark a subset of what you've just marked unread as read, mark unread again and try the matching stuff, etc. to get a feel for how it works and to be sure it doesn't break anything.

The expression matching part of the mark read/unread is disabled for mysql but I think the queries to do the time based stuff are right.

To use: create a directory in your plugins directory called "markdown_plus" and put the files there. This plugin needs to be a system plugin, so add to your config.php. Finally, if you are using postgresql you'll need pg_trgm enabled for the expression matching capability to work.


**REMINDER alpha code - USE AT YOUR OWN RISK**

NOTE: I travel a lot and so might be slow to respond to any issues posted. Sorry.
Attachments
markread_plus.zip
(5.05 KiB) Downloaded 208 times

arjuan
Bear Rating Trainee
Bear Rating Trainee
Posts: 2
Joined: 11 Aug 2016, 00:29

Re: Plugin to mark articles read/unread

Postby arjuan » 04 Apr 2017, 22:42

I have been meaning to write a plugin for this exact feature. So thank you!!! Will test and let you know.


Return to “Themes and plugins”

Who is online

Users browsing this forum: No registered users and 1 guest