list-card icon indicating copy to clipboard operation
list-card copied to clipboard

Possibility to scroll down automatically the list for news display

Open frantzphilippe opened this issue 2 years ago • 1 comments

Hello, I use this card after a feedparser of a RSS news stream, and it works very well. I was wondering if this could be possible to automatically scroll down the list, or to select randomly only one row to display. It should be possible using a javascript on the DIV displaying the card, but what I tried didn't work so far. How should I proceed ? I thank you for your help. Regards.

frantzphilippe avatar Jan 31 '23 10:01 frantzphilippe

I have a pull-request in for some changes I submitted but I think this would work in either code base. Add this above the line for (let entry in feed) { `// Choose a random index for the entry to keep const randomIndex = Math.floor(Math.random() * feed.length);

// Save the random entry const randomEntry = feed[randomIndex];

// Delete all other entries feed.splice(0, randomIndex); feed.splice(1, feed.length - 1);`

versile2 avatar Mar 18 '24 20:03 versile2