Skip to content

news, stock-news: rotate through a pool of stories (1.7.0, 2.9.0) - #612

Merged
ChuckBuilds merged 1 commit into
mainfrom
claude/stock-news-rotation-f62159
Oct 3, 2026
Merged

ChuckBuilds merged 1 commit into
mainfrom
claude/stock-news-rotation-f62159

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Problem

The news and stock-news tickers kept showing the same headlines. On the live board:

  • news (NFL, NCAA FB, NHL): headlines_per_feed was 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.
  • stock-news (8 symbols): 1 story per symbol, 8 total, re-fetched every ~2 minutes, always each symbol's top Yahoo story. Order was reshuffled, content never changed. A story carried by two tickers showed twice.

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.

  • New advanced settings global.headline_pool_size (default 10, 1-30) and global.max_headline_age_hours (default 48, 0 = off).
  • Each pass (news: cycle or page) picks, per source: fresh before stale, never-shown before shown (oldest shown first), then the source's own order. A story already picked from another source is skipped.
  • If a source has nothing unseen, the old shift-the-lead-headline rotation still applies.
  • news paging picks new stories when its window wraps; the stock-news Vegas strip advances the same way.
  • headlines_per_feed, max_headlines_per_symbol, headlines_per_rotation now mean "shown at a time"; defaults and saved configs keep the same strip size. Yahoo is still one request per symbol (larger newsCount).
  • news 1.7.0, stock-news 2.9.0; schemas and READMEs updated.

Testing

  • New test_headlines_rotate_through_pool.py in each plugin: pool walking and wrap-around, cross-source duplicates, stale handling, no-unseen fallback, forgetting dropped stories, paging, pool sizing.
  • Existing news and stock-news tests pass; check_version_bump, module-collision, property-order, inert-settings and manifest-ASCII checks pass.
  • Not run: the core check_plugin.py harness, or on the board. The render path is untouched; the fetch/update path is not.
  • Shown-story memory is in-process, so a restart starts again from each source's top stories.

🤖 Generated with Claude Code

…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>
@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 52325fe7-54e6-4f9d-bbc3-84f6a6f3b4d3
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ChuckBuilds
ChuckBuilds merged commit f41dad7 into main Oct 3, 2026
2 of 4 checks passed
@ChuckBuilds
ChuckBuilds deleted the claude/stock-news-rotation-f62159 branch October 3, 2026 16:08
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 74 complexity

Metric Results
Complexity 74

View in Codacy

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.

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

Successfully merging this pull request may close these issues.

1 participant