-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[WordPress] Limit feed to 20 items #1801
Conversation
Very large feeds will fail to load otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @ORelio! I suggest to discard those 20+ items instead of leaving unexpanded. In feed readers like Tiny Tiny RSS old items will be rewrited to unexpanded, if we leave like this.
Very large feeds will fail to load otherwise
Sure, done. Now the feed is truncated to 20 items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use collectExpandableDatas()
to limit number of items returned, its simpler than your current method.
try{
$this->collectExpandableDatas($this->getURI() . '/feed/atom/', 20);
} catch (Exception $e) {
$this->collectExpandableDatas($this->getURI() . '/?feed=atom', 20);
}
Oh nice, thanks @VerifiedJoseph for the tip! Done. |
Thanks @ORelio and @VerifiedJoseph ! |
I encountered a WordPress site having all its articles from the beginning in its feed, which meant hundreds of entries.
Fetching all the articles is time consuming, so the feed failed to load in RSS-Bridge because of a script timeout.
This PR adds a limit of 20 items in WordPress bridge to keep load times reasonable and avoid hammering the target site.
Extra items are kept unexpanded so they will still be present in the feed.