Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to scroll down automatically the list for news display #54

Open
frantzphilippe opened this issue Jan 31, 2023 · 1 comment

Comments

@frantzphilippe
Copy link

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.

@versile2
Copy link

versile2 commented Mar 18, 2024

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);`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants