purge content of read articles

Request new functionality here
roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

purge content of read articles

Postby roshambo » 21 Jun 2013, 10:17

When a lot of expanded articles have been read the browser slows down and never recovers until a refresh, this is common with rss readers. A way to improve it is removing the content of the read articles, which can be done with http://userscripts.org/scripts/review/62063. I've tried hacking it to work with ttrss with no luck, this is what it currently looks like:

Code: Select all

var intPurgeTimeout = 60000; // set the timeout in ms to run the check for elements to purge

function purgeRead()
{
   var intPastRead = 10; // how many old elements to keep

   var objCurrent = document.getElementByClass('cdm expanded active selected');
   if (objCurrent != undefined)
   {
      var intPast = 0;
      var objP = objCurrent;
      while (intPast <= intPastRead && objP != undefined)
      {
         objP = objP.previousSibling;
         intPast++;
      }
      while (objP != undefined)
      {
         var arrId = objP.IDName.split(' ');
         var intId = arrID.length;
         var boolPurged = false;
         var boolRead = false;
         for (var i=0;i<intID;i++)
         {
            if (arrID[i] == 'read')
            {
               boolRead = true;
            }
            if (arrID[i] == 'purged')
            {
               boolPurged = true;
            }
         }
         if (boolRead == true && boolPurged == false)
         {
            console.log('TTRSS Purge: Removing item with ID of "'+objP.IDName+'"');
            objP.IDName = objP.IDName+' purged';
            //var objRemoves = objP.childNodes;
            var objRemoves = objP.getElementsByClassName('cdmContent');
            for (var i=objRemoves.length; i > 0; i--)
            {
               objRemoves[i-1].parentNode.style.height = objRemoves[i-1].parentNode.clientHeight+'px';
               
               objRemoves[i-1].innerHTML = 'Content purged';
               objRemoves[i-1].parentNode.removeChild(objRemoves[i-1]);
            }
         }
         objP = objP.previousSibling;
      }
   }
}

console.log('TTRSS Purge: Initilizing purger to '+intPurgeTimeout+' millisecond interval.');
setInterval(purgeRead, intPurgeTimeout);


Would someone be able to help me get this userscript working or create a ttrss plugin that can purge content while viewing? TIA

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

Re: purge content of read articles

Postby fox » 21 Jun 2013, 11:46

>When a lot of expanded articles have been read the browser slows down and never recovers until a refresh, this is common with rss readers.

I'd say your shitty PC is being a common factor here.

User avatar
blainemono
Gaping Anus of Eternity
Gaping Anus of Eternity
Posts: 246
Joined: 05 Jun 2009, 18:13

Re: purge content of read articles

Postby blainemono » 21 Jun 2013, 12:05

meh, browsers are rather shitty too this season

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: purge content of read articles

Postby roshambo » 21 Jun 2013, 12:10

About the same viewing on an FX8320 8GB, i3 3GB, Athlon II 620 4GB, or celeron G1610 2GB. As well as remotely hosted or hosted on FX8320. I think the main problem is 100's of flash videos on a page isn't handled well by browsers.

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

Re: purge content of read articles

Postby fox » 21 Jun 2013, 12:16

I don't see how inadequacies of terrible adobe software are related to this forum, especially because OOB tt-rss does not really support embedded flash. Set it to click to play or remove flash altogether.

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: purge content of read articles

Postby roshambo » 22 Jun 2013, 02:52

Flash is just what it mainly is in my case. GIF and images slow down browsers in excess. The rare time I come across a gif it's a noticeable slow down, I think they are heavier than flash per instance. It's all about freeing resources that are no longer required which a refresh and this purge script/plugin would do. It really does make a big difference if you have a lot of articles to go through.

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: purge content of read articles

Postby sleeper_service » 22 Jun 2013, 03:15

roshambo wrote:Flash is just what it mainly is in my case. GIF and images slow down browsers in excess. The rare time I come across a gif it's a noticeable slow down, I think they are heavier than flash per instance. It's all about freeing resources that are no longer required which a refresh and this purge script/plugin would do. It really does make a big difference if you have a lot of articles to go through.

you're just all sorts of screwed up, aren't you?

first that chrome links folderol, and now this.

one wonders what you're going to demand be changed to suit you next.

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: purge content of read articles

Postby roshambo » 22 Jun 2013, 03:42

I was wrong about flash being the main problem. Disabling videoframes plugin for OOBE to read 480+ feeds needed 3 refreshes, the tab was continuously loading every time. Refreshes were all unusually long, 1-3 seconds, typically it's instant.

This is the last of getting back the previous experience and it's not just to suit me, there are other users purging articles in other readers and users expecting more than one process for tabs in chrome.

I'm surprised no one else is experiencing these things. May be the amount of articles, the feeds I subscribe to or using expanded or just simply being used to the always refreshed responsiveness. I'll try collapsed view and see if that improves the situation.

EDIT: Collapsed didn't help much, within a 100 articles from http://www.buzzfeed.com/index.xml chrome and firefox are very slow. With GR purging both browsers are still very responsive.

gbcox
Bear Rating Master
Bear Rating Master
Posts: 149
Joined: 25 Apr 2013, 04:52

Re: purge content of read articles

Postby gbcox » 22 Jun 2013, 05:03

FWIW I have lots of feeds that have photos... I don't cache them and I'm not having any performance issues. I also never delete anything.

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

Re: purge content of read articles

Postby fox » 22 Jun 2013, 23:34

>I'm surprised no one else is experiencing these things

Maybe they don't have shit PCs

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: purge content of read articles

Postby roshambo » 25 Jun 2013, 02:00

CPU usage rarely touches 5% when reading and memory usage can be as low as 30% when it happens.

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: purge content of read articles

Postby sleeper_service » 25 Jun 2013, 05:04

roshambo wrote:CPU usage rarely touches 5% when reading and memory usage can be as low as 30% when it happens.
well, maybe it just doesn't like you.

I'm starting to see it's POV.

lotrfan
Bear Rating Disaster
Bear Rating Disaster
Posts: 73
Joined: 18 Mar 2013, 04:42

Re: purge content of read articles

Postby lotrfan » 25 Jun 2013, 05:56

If you're running trunk, the hotkey "Shift+x" should dismiss, and remove the content of, read articles. It keeps the headlines in the DOM (they're only hidden), but at least the content is gone.
If you're not running trunk, then run trunk (or wait until 1.8.1 comes out)

roshambo
Bear Rating Trainee
Bear Rating Trainee
Posts: 35
Joined: 19 Jun 2013, 20:03

Re: purge content of read articles

Postby roshambo » 26 Jun 2013, 00:20

lotrfan: thanks again! It sounds similar to what the userscript would do and more efficient. I'll try looking into installing trunk when I get more time later this week. Do you know if removing content could be done automatically? Either by purging content of all read articles and when they are selected again reload the content or setting to purge content of read articles except for last (1, 3, 5, 10, etc.).

lotrfan
Bear Rating Disaster
Bear Rating Disaster
Posts: 73
Joined: 18 Mar 2013, 04:42

Re: purge content of read articles

Postby lotrfan » 26 Jun 2013, 21:02

roshambo wrote:lotrfan: thanks again!

You're welcome!
roshambo wrote:Do you know if removing content could be done automatically? Either by purging content of all read articles and when they are selected again reload the content or setting to purge content of read articles except for last (1, 3, 5, 10, etc.).

It might be possible to write a plugin that calls dismissReadArticles() (the javascript function that does the actual dismissing/removing of content) automatically, but some work would have to be done to fix the "jumpiness" - when dismissing articles, the scroll position doesn't stay the same, which would be disorienting if it happened automatically. (I guess an alternative would be to write a new function that only removes the content.)

As for reloading the content dynamically, I briefly looked into it, but I didn't find an api call that returns the content of only one article.

edit: actually there is an api call (getArticle). It might be possible then.


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 4 guests