feat(sources): retire Yahoo and CNBC feeds (#42)

This commit is contained in:
2026-11-25 02:00:25 +01:00
parent 7a342f240d
commit 0503c2653f
41 changed files with 603 additions and 173 deletions

View File

@ -34,13 +34,13 @@ func (f *contentFeed) Enrich(_ context.Context, a []scraper.Article) ([]scraper.
func TestTicket36EnrichmentAfterPoolAndNoReordering(t *testing.T) {
for _, mode := range []string{"title_content", "title", "failure", "other_source"} {
t.Run(mode, func(t *testing.T) {
source := models.SourceBloomberg
source := models.SourceInvesting
rankingMode := mode
if mode == "failure" || mode == "other_source" {
rankingMode = "title_content"
}
if mode == "other_source" {
source = models.SourceYahooFinance
source = models.SourceBloomberg
}
feed := &contentFeed{fail: mode == "failure", contractScraper: contractScraper{articles: []scraper.Article{{Title: "Fixture first"}, {Title: "Fixture second"}, {Title: "excluded"}}}}
repo := &contractRepository{inputs: map[string]UserInput{"u": {Language: "fr", RankingMode: rankingMode, GlobalLimit: 2, Assets: []models.UserAsset{{Name: "Fixture"}}, Sources: []models.Source{{ID: "s", SourceKey: testSourceKey(source), Enabled: true, ArticleLimit: 2}}}}, saved: map[string][]GenerationRecord{}}
@ -74,7 +74,7 @@ func TestTicket36EnrichmentAfterPoolAndNoReordering(t *testing.T) {
}
func TestTicket36EnrichedDateDoesNotChangeCrossSourceOrder(t *testing.T) {
keyB, keyY := models.SourceBloomberg, models.SourceYahooFinance
keyB, keyY := models.SourceInvesting, models.SourceBloomberg
feed := &contentFeed{contractScraper: contractScraper{articles: []scraper.Article{{Title: "Fixture Bloomberg"}}}}
old := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC)
other := &contractScraper{articles: []scraper.Article{{Title: "Fixture Yahoo", ContentState: scraper.ContentComplete, Content: "synthetic full Yahoo body", PublishedAt: &old}}}