Compare commits
4 Commits
333788d43b
...
4842e3a9fc
| Author | SHA1 | Date | |
|---|---|---|---|
| 4842e3a9fc | |||
| 52aaa8545d | |||
| cbd1c0bfcf | |||
| 797deb62f4 |
29
daily/2026-02-25.md
Normal file
29
daily/2026-02-25.md
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# AI Daily Brief - 2026-02-25
|
||||||
|
|
||||||
|
> 采集时间: 2026/2/25 23:00:25
|
||||||
|
> 总条目: 6
|
||||||
|
|
||||||
|
## 🔥 Top 10 重要消息
|
||||||
|
|
||||||
|
1. [login?return_to=%2Fliyupi%2Fai-guide](https://github.com/login?return_to=%2Fliyupi%2Fai-guide) - **GitHub Trending**
|
||||||
|
> 程序员鱼皮的 AI 资源大全 + Vibe Coding 零基础教程,分享大模型选择指南(DeepSeek / GPT / Gemini / Claude)、最新 AI 资讯、Prompt 提示词大全、AI 知识百科(RAG / MCP / A2A)、AI 编程教程、AI 工具用法(Cursor /...
|
||||||
|
|
||||||
|
2. [login?return_to=%2Fdatawhalechina%2Fhello-agents](https://github.com/login?return_to=%2Fdatawhalechina%2Fhello-agents) - **GitHub Trending**
|
||||||
|
> 📚 《从零开始构建智能体》——从零开始的智能体原理与实践教程
|
||||||
|
|
||||||
|
3. [login?return_to=%2FshareAI-lab%2Flearn-claude-code](https://github.com/login?return_to=%2FshareAI-lab%2Flearn-claude-code) - **GitHub Trending**
|
||||||
|
> Bash is all you need - A nano Claude Code–like agent, built from 0 to 1
|
||||||
|
|
||||||
|
4. [login?return_to=%2Fkatanemo%2Fplano](https://github.com/login?return_to=%2Fkatanemo%2Fplano) - **GitHub Trending**
|
||||||
|
> Delivery infrastructure for agentic apps - Plano is an AI-native proxy and data plane that offloads plumbing work, so you stay focused on your agent's...
|
||||||
|
|
||||||
|
5. [login?return_to=%2Fbytedance%2Fdeer-flow](https://github.com/login?return_to=%2Fbytedance%2Fdeer-flow) - **GitHub Trending**
|
||||||
|
> An open-source SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skills and subagents, it handles d...
|
||||||
|
|
||||||
|
6. [login?return_to=%2FNVIDIA%2FMegatron-LM](https://github.com/login?return_to=%2FNVIDIA%2FMegatron-LM) - **GitHub Trending**
|
||||||
|
> Ongoing research training transformer models at scale
|
||||||
|
|
||||||
|
## 📂 分类汇总
|
||||||
|
|
||||||
|
---
|
||||||
|
*Generated by AINewsCollector*
|
||||||
174
skill/ai-news-collector/feishu-card.js
Normal file
174
skill/ai-news-collector/feishu-card.js
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 飞书卡片消息格式化
|
||||||
|
* 生成可点击链接的富文本卡片
|
||||||
|
*/
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const DAILY_DIR = path.join(__dirname, '../../daily');
|
||||||
|
|
||||||
|
function getYesterdayDate() {
|
||||||
|
const d = new Date();
|
||||||
|
d.setDate(d.getDate() - 1);
|
||||||
|
return d.toLocaleDateString('zh-CN', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
timeZone: 'Asia/Shanghai'
|
||||||
|
}).replace(/\//g, '-');
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseMarkdown(markdown) {
|
||||||
|
const lines = markdown.split('\n');
|
||||||
|
const items = [];
|
||||||
|
let currentTime = '';
|
||||||
|
let totalItems = 0;
|
||||||
|
|
||||||
|
// 解析元数据
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
const line = lines[i];
|
||||||
|
if (line.startsWith('> 采集时间:')) {
|
||||||
|
currentTime = line.replace('> 采集时间:', '').trim();
|
||||||
|
}
|
||||||
|
if (line.startsWith('> 总条目:')) {
|
||||||
|
totalItems = parseInt(line.replace('> 总条目:', '').trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析新闻条目
|
||||||
|
const itemRegex = /^(\d+)\.\s+\[([^\]]+)\]\(([^)]+)\)\s+-\s+\*\*([^*]+)\*\*/;
|
||||||
|
let currentItem = null;
|
||||||
|
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
const line = lines[i];
|
||||||
|
const match = line.match(itemRegex);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
if (currentItem) {
|
||||||
|
items.push(currentItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理URL
|
||||||
|
let url = match[3];
|
||||||
|
let title = match[2];
|
||||||
|
|
||||||
|
if (url.includes('login?return_to=')) {
|
||||||
|
const realPath = decodeURIComponent(url.split('return_to=')[1]);
|
||||||
|
url = `https://github.com${realPath}`;
|
||||||
|
title = realPath.replace('/', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
currentItem = {
|
||||||
|
number: match[1],
|
||||||
|
title: title,
|
||||||
|
url: url,
|
||||||
|
source: match[4],
|
||||||
|
description: ''
|
||||||
|
};
|
||||||
|
} else if (currentItem && line.trim().startsWith('>') && !line.includes('采集时间') && !line.includes('总条目')) {
|
||||||
|
currentItem.description = line.replace(/^\s*>\s*/, '').trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentItem) {
|
||||||
|
items.push(currentItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { currentTime, totalItems, items };
|
||||||
|
}
|
||||||
|
|
||||||
|
function createFeishuCard(data) {
|
||||||
|
const { currentTime, totalItems, items } = data;
|
||||||
|
|
||||||
|
const elements = [
|
||||||
|
{
|
||||||
|
tag: "div",
|
||||||
|
text: {
|
||||||
|
tag: "lark_md",
|
||||||
|
content: `**⏰ 采集时间**: ${currentTime}\n**📊 总条目**: ${totalItems}条`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "hr"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 添加新闻条目
|
||||||
|
items.forEach((item, index) => {
|
||||||
|
const num = ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣', '🔟'][index] || `${index + 1}.`;
|
||||||
|
|
||||||
|
elements.push({
|
||||||
|
tag: "div",
|
||||||
|
text: {
|
||||||
|
tag: "lark_md",
|
||||||
|
content: `${num} **${item.title}**\n\`${item.source}\`\n> ${item.description}\n[🔗 点击查看详情](${item.url})`
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 每条之间加分隔线(除了最后一条)
|
||||||
|
if (index < items.length - 1) {
|
||||||
|
elements.push({
|
||||||
|
tag: "hr"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 添加底部提示
|
||||||
|
elements.push({
|
||||||
|
tag: "hr"
|
||||||
|
});
|
||||||
|
elements.push({
|
||||||
|
tag: "note",
|
||||||
|
elements: [
|
||||||
|
{
|
||||||
|
tag: "plain_text",
|
||||||
|
content: "💡 点击链接跳转到GitHub查看详情\n*Generated by AINewsCollector*"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
msg_type: "interactive",
|
||||||
|
card: {
|
||||||
|
header: {
|
||||||
|
title: {
|
||||||
|
tag: "plain_text",
|
||||||
|
content: `📰 AI Daily Brief - ${getYesterdayDate()}`
|
||||||
|
},
|
||||||
|
template: "blue"
|
||||||
|
},
|
||||||
|
elements: elements
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const yesterday = getYesterdayDate();
|
||||||
|
const reportPath = path.join(DAILY_DIR, `${yesterday}.md`);
|
||||||
|
|
||||||
|
if (!fs.existsSync(reportPath)) {
|
||||||
|
console.log(`❌ 未找到昨日简报: ${reportPath}`);
|
||||||
|
return { success: false, error: 'Report not found' };
|
||||||
|
}
|
||||||
|
|
||||||
|
const markdown = fs.readFileSync(reportPath, 'utf8');
|
||||||
|
const data = parseMarkdown(markdown);
|
||||||
|
const card = createFeishuCard(data);
|
||||||
|
|
||||||
|
console.log(JSON.stringify(card, null, 2));
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
date: yesterday,
|
||||||
|
card: card
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (require.main === module) {
|
||||||
|
main().catch(console.error);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { main, createFeishuCard, parseMarkdown };
|
||||||
189
skill/ai-news-collector/format-push.js
Normal file
189
skill/ai-news-collector/format-push.js
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 格式化AI新闻简报 - 飞书友好版本(含中文翻译)
|
||||||
|
* 生成易读、链接可点击的消息格式
|
||||||
|
*/
|
||||||
|
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const DAILY_DIR = path.join(__dirname, '../../daily');
|
||||||
|
|
||||||
|
// 简单的翻译映射(常见术语)
|
||||||
|
const termMap = {
|
||||||
|
'web browser': '网页浏览器',
|
||||||
|
'browser': '浏览器',
|
||||||
|
'independent': '独立的',
|
||||||
|
'framework': '框架',
|
||||||
|
'methodology': '方法论',
|
||||||
|
'agentic': '代理式',
|
||||||
|
'adaptive': '自适应',
|
||||||
|
'web scraping': '网页爬取',
|
||||||
|
'framework': '框架',
|
||||||
|
'high performance': '高性能',
|
||||||
|
'vector graph': '向量图',
|
||||||
|
'real time': '实时',
|
||||||
|
'analytics': '分析',
|
||||||
|
'portrait': '肖像',
|
||||||
|
'animation': '动画',
|
||||||
|
'live streaming': '直播',
|
||||||
|
'health records': '健康记录',
|
||||||
|
'medical practice': '医疗实践',
|
||||||
|
'management': '管理',
|
||||||
|
'solution': '解决方案',
|
||||||
|
'open source': '开源',
|
||||||
|
'tool': '工具',
|
||||||
|
'location': '位置',
|
||||||
|
'mobile number': '手机号码',
|
||||||
|
'track': '追踪',
|
||||||
|
'system': '系统',
|
||||||
|
'built in': '构建于',
|
||||||
|
'focused on': '专注于'
|
||||||
|
};
|
||||||
|
|
||||||
|
function translateToChinese(text) {
|
||||||
|
let translated = text;
|
||||||
|
|
||||||
|
// 替换常见术语
|
||||||
|
for (const [eng, chi] of Object.entries(termMap)) {
|
||||||
|
const regex = new RegExp(eng, 'gi');
|
||||||
|
translated = translated.replace(regex, chi);
|
||||||
|
}
|
||||||
|
|
||||||
|
return translated;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getYesterdayDate() {
|
||||||
|
const d = new Date();
|
||||||
|
d.setDate(d.getDate() - 1);
|
||||||
|
return d.toLocaleDateString('zh-CN', {
|
||||||
|
year: 'numeric',
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
timeZone: 'Asia/Shanghai'
|
||||||
|
}).replace(/\//g, '-');
|
||||||
|
}
|
||||||
|
|
||||||
|
function parseMarkdown(markdown) {
|
||||||
|
const lines = markdown.split('\n');
|
||||||
|
const items = [];
|
||||||
|
let currentDate = '';
|
||||||
|
let currentTime = '';
|
||||||
|
let totalItems = 0;
|
||||||
|
|
||||||
|
// 解析元数据
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
const line = lines[i];
|
||||||
|
if (line.startsWith('> 采集时间:')) {
|
||||||
|
currentTime = line.replace('> 采集时间:', '').trim();
|
||||||
|
}
|
||||||
|
if (line.startsWith('> 总条目:')) {
|
||||||
|
totalItems = parseInt(line.replace('> 总条目:', '').trim());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析新闻条目
|
||||||
|
const itemRegex = /^(\d+)\.\s+\[([^\]]+)\]\(([^)]+)\)\s+-\s+\*\*([^*]+)\*\*/;
|
||||||
|
let currentItem = null;
|
||||||
|
|
||||||
|
for (let i = 0; i < lines.length; i++) {
|
||||||
|
const line = lines[i];
|
||||||
|
const match = line.match(itemRegex);
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
if (currentItem) {
|
||||||
|
items.push(currentItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 清理URL,移除登录页面
|
||||||
|
let url = match[3];
|
||||||
|
let title = match[2];
|
||||||
|
|
||||||
|
// 如果是登录页面,提取真实路径
|
||||||
|
if (url.includes('login?return_to=')) {
|
||||||
|
const realPath = decodeURIComponent(url.split('return_to=')[1]);
|
||||||
|
url = `https://github.com${realPath}`;
|
||||||
|
title = realPath.replace('/', ''); // 使用真实仓库名
|
||||||
|
}
|
||||||
|
|
||||||
|
currentItem = {
|
||||||
|
number: match[1],
|
||||||
|
title: title,
|
||||||
|
url: url,
|
||||||
|
source: match[4],
|
||||||
|
description: ''
|
||||||
|
};
|
||||||
|
} else if (currentItem && line.trim().startsWith('>') && !line.includes('采集时间') && !line.includes('总条目')) {
|
||||||
|
// 移除所有 > 符号和前导空格
|
||||||
|
currentItem.description = line.replace(/^\s*>\s*/, '').trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentItem) {
|
||||||
|
items.push(currentItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { currentTime, totalItems, items };
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatForFeishu(data) {
|
||||||
|
const { currentTime, totalItems, items } = data;
|
||||||
|
|
||||||
|
let message = `📰 AI Daily Brief - ${getYesterdayDate()}\n\n`;
|
||||||
|
message += `⏰ 采集时间: ${currentTime}\n`;
|
||||||
|
message += `📊 总条目: ${totalItems}条\n\n`;
|
||||||
|
message += `━━━━━━━━━━━━━━━━━━━━\n\n`;
|
||||||
|
message += `🔥 今日热点\n\n`;
|
||||||
|
|
||||||
|
items.forEach((item, index) => {
|
||||||
|
const num = ['1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣', '🔟'][index] || `${index + 1}.`;
|
||||||
|
|
||||||
|
message += `${num} ${item.title}\n`;
|
||||||
|
message += `${item.source}\n`;
|
||||||
|
if (item.description) {
|
||||||
|
// 添加中文翻译
|
||||||
|
const translated = translateToChinese(item.description);
|
||||||
|
message += `${translated}\n`;
|
||||||
|
// 如果翻译后不同,显示原文
|
||||||
|
if (translated !== item.description) {
|
||||||
|
message += `(原文:${item.description})\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
message += `🔗 ${item.url}\n\n`;
|
||||||
|
});
|
||||||
|
|
||||||
|
message += `━━━━━━━━━━━━━━━━━━━━\n`;
|
||||||
|
message += `💡 点击链接跳转到GitHub查看详情\n`;
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
const yesterday = getYesterdayDate();
|
||||||
|
const reportPath = path.join(DAILY_DIR, `${yesterday}.md`);
|
||||||
|
|
||||||
|
if (!fs.existsSync(reportPath)) {
|
||||||
|
console.log(`❌ 未找到昨日简报: ${reportPath}`);
|
||||||
|
return { success: false, error: 'Report not found' };
|
||||||
|
}
|
||||||
|
|
||||||
|
const markdown = fs.readFileSync(reportPath, 'utf8');
|
||||||
|
const data = parseMarkdown(markdown);
|
||||||
|
const formattedMessage = formatForFeishu(data);
|
||||||
|
|
||||||
|
console.log('格式化后的消息:');
|
||||||
|
console.log(formattedMessage);
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
date: yesterday,
|
||||||
|
message: formattedMessage
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (require.main === module) {
|
||||||
|
main().catch(console.error);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { main, formatForFeishu, parseMarkdown };
|
||||||
Loading…
x
Reference in New Issue
Block a user