phase-1: optimize code

This commit is contained in:
Kazuma
2026-06-04 01:32:05 -04:00
parent cd74497de6
commit 3513024fc6
58 changed files with 7380 additions and 850 deletions
+4 -3
View File
@@ -5,15 +5,16 @@ const MAX_STORIES = 15;
const TICKER_REGEX = /^[A-Z]{1,6}$/;
export class CatalystAnalyst {
constructor() {
constructor({ logger } = {}) {
this.client = new YahooClient();
this.logger = logger ?? { write: (msg) => process.stdout.write(msg) };
}
async run() {
process.stdout.write('🔍 Fetching market news...');
this.logger.write('🔍 Fetching market news...');
const stories = await this._fetchNews();
const tickers = this._extractTickers(stories);
process.stdout.write(` ${stories.length} stories, ${tickers.length} tickers\n`);
this.logger.write(` ${stories.length} stories, ${tickers.length} tickers\n`);
return { tickers, stories };
}