pipeline: scrape → embed (nomic) → cluster → summarize (glm-4.7-flash) posts weekly clustered themes to #weekly-trends channel. uses remote qdrant at vectors.biohazardvfx.com. also adds discord webhook posting support (src/post.ts).
56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import { run as reddit } from './feeds/reddit-digest';
|
|
import { run as trending } from './feeds/github-trending';
|
|
import { run as newRepos } from './feeds/new-ai-repos';
|
|
import { run as claudeReleases } from './feeds/claude-code-releases';
|
|
import { run as twitter } from './feeds/twitter-ai';
|
|
import { run as weeklyTrends } from './feeds/weekly-trends';
|
|
import { log } from './utils';
|
|
|
|
const COMMANDS: Record<string, () => Promise<string>> = {
|
|
reddit,
|
|
trending,
|
|
'new-repos': newRepos,
|
|
'claude-releases': claudeReleases,
|
|
twitter,
|
|
'weekly-trends': weeklyTrends,
|
|
};
|
|
|
|
async function main() {
|
|
const cmd = process.argv[2];
|
|
|
|
if (!cmd || cmd === '--help' || cmd === '-h') {
|
|
console.error(
|
|
'Usage: bun run feed <reddit|trending|' +
|
|
'new-repos|claude-releases|twitter|weekly-trends|all>'
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
if (cmd === 'all') {
|
|
for (const [name, fn] of Object.entries(COMMANDS)) {
|
|
log(`\n--- ${name} ---`);
|
|
const output = await fn();
|
|
if (output) console.log(output);
|
|
}
|
|
return;
|
|
}
|
|
|
|
const fn = COMMANDS[cmd];
|
|
if (!fn) {
|
|
console.error(`Unknown command: ${cmd}`);
|
|
console.error(
|
|
`Available: ${Object.keys(COMMANDS).join(', ')}, all`
|
|
);
|
|
process.exit(1);
|
|
}
|
|
|
|
const output = await fn();
|
|
if (output) console.log(output);
|
|
else log('(no output)');
|
|
}
|
|
|
|
main().catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
});
|