news, stock-news: rotate through a pool of stories (1.7.0, 2.9.0) - #612
Merged
Merged
Conversation
…ng the top few (1.7.0, 2.9.0) Both tickers fetched only as many stories as they showed (2 per feed, 1 per symbol), so every pass repeated the same headlines until a source published something new; rotation only reordered them. They now fetch global.headline_pool_size stories per source (default 10) and each pass or page shows the least-recently-shown ones, newest first. A story carried by two sources is shown once, and one older than global.max_headline_age_hours (default 48) is used only when nothing newer exists. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 74 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The news and stock-news tickers kept showing the same headlines. On the live board:
headlines_per_feedwas both the number fetched and the number shown, so the pool was 6 stories. The strip carried all 6 every cycle; "rotation" only changed which led.Yahoo returns 10 distinct recent stories for the same request (checked for NVDA), so the plugin was discarding most of what it fetched.
Change
Both plugins now fetch a pool and show the least-recently-shown stories from it.
global.headline_pool_size(default 10, 1-30) andglobal.max_headline_age_hours(default 48, 0 = off).headlines_per_feed,max_headlines_per_symbol,headlines_per_rotationnow mean "shown at a time"; defaults and saved configs keep the same strip size. Yahoo is still one request per symbol (largernewsCount).Testing
test_headlines_rotate_through_pool.pyin each plugin: pool walking and wrap-around, cross-source duplicates, stale handling, no-unseen fallback, forgetting dropped stories, paging, pool sizing.check_version_bump, module-collision, property-order, inert-settings and manifest-ASCII checks pass.check_plugin.pyharness, or on the board. The render path is untouched; the fetch/update path is not.🤖 Generated with Claude Code