From 74cc880e7c57af2e4f593f18687f4e34e765d9c9 Mon Sep 17 00:00:00 2001 From: "SnakeEye-sudo (Er. Sangam Krishna)" Date: Sat, 2 May 2026 16:02:23 +0530 Subject: [PATCH 1/2] Add uisdc news adapter for CLI Implements a CLI adapter for fetching the latest AI/design news from uisdc.com. Allows specifying the number of news items to return. --- clis/uisdc/news.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 clis/uisdc/news.js diff --git a/clis/uisdc/news.js b/clis/uisdc/news.js new file mode 100644 index 00000000..ae5d496f --- /dev/null +++ b/clis/uisdc/news.js @@ -0,0 +1,43 @@ +/** + * uisdc news adapter + * + * Fetches the latest AI/design industry news from 优设读报 (uisdc.com/news). + * Uses browser scraping via CSS selectors on the news list. + * + * Usage: + * opencli uisdc news + * opencli uisdc news --limit 10 + */ +import { cli, Strategy } from '@jackwener/opencli/registry'; + +cli({ + site: 'uisdc', + name: 'news', + description: '优设读报 - 最新 AI/设计行业新闻', + domain: 'www.uisdc.com', + strategy: Strategy.PUBLIC, + browser: true, + args: [ + { name: 'limit', type: 'int', default: 20, help: 'Number of news items to return' }, + ], + columns: ['rank', 'title', 'summary'], + pipeline: [ + { navigate: 'https://www.uisdc.com/news' }, + { + evaluate: ` + const items = Array.from( + document.querySelectorAll( + '.news-list > .news-item:first-child > .item-content > .dubao-items > .dubao-item' + ) + ); + return items.map((el, i) => ({ + rank: i + 1, + title: el.querySelector('.dubao-title')?.textContent?.trim() ?? '', + summary: el.querySelector('.dubao-content')?.textContent?.trim() ?? '', + url: el.querySelector('a')?.href ?? '', + })); + `, + }, + { limit: '${{ args.limit }}' }, + ], +}); From ebe72603866e65a49ed9b479ba750cd3e0503d25 Mon Sep 17 00:00:00 2001 From: "SnakeEye-sudo (Er. Sangam Krishna)" Date: Sat, 2 May 2026 16:03:21 +0530 Subject: [PATCH 2/2] feat(aibase): add aibase daily news adapter This file implements a news adapter for AIbase that fetches the latest AI industry news and allows for configurable limits on the number of news items returned. --- clis/aibase/news.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 clis/aibase/news.js diff --git a/clis/aibase/news.js b/clis/aibase/news.js new file mode 100644 index 00000000..f907b710 --- /dev/null +++ b/clis/aibase/news.js @@ -0,0 +1,40 @@ +/** + * aibase news adapter + * + * Fetches the latest AI industry daily news from AIbase (日报). + * Scrapes article links from aibase.com/zh/daily. + * + * Usage: + * opencli aibase news + * opencli aibase news --limit 10 + */ +import { cli, Strategy } from '@jackwener/opencli/registry'; + +cli({ + site: 'aibase', + name: 'news', + description: 'AIbase 日报 - 每天三分钟关注AI行业趋势', + domain: 'www.aibase.com', + strategy: Strategy.PUBLIC, + browser: true, + args: [ + { name: 'limit', type: 'int', default: 20, help: 'Number of news items to return' }, + ], + columns: ['rank', 'title', 'url'], + pipeline: [ + { navigate: 'https://www.aibase.com/zh/daily' }, + { + evaluate: ` + const items = Array.from( + document.querySelectorAll('.bg-white .grid a') + ).filter(el => el.href && el.textContent.trim()); + return items.map((el, i) => ({ + rank: i + 1, + title: el.textContent.trim(), + url: el.href, + })); + `, + }, + { limit: '${{ args.limit }}' }, + ], +});