Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add darioamodei route #18187

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

EricX37
Copy link

@EricX37 EricX37 commented Jan 22, 2025

Involved Issue / 该 PR 相关 Issue

Close #

Example for the Proposed Route(s) / 路由地址示例

/darioamodei

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

  • 添加 Dario Amodei 个人网站的 RSS 订阅支持
  • 支持文章标题、发布日期、预览内容的订阅
  • 主要关注 Essays(文章)部分的更新
  • 使用 cheerio 解析 HTML,不需要额外的包
  • 已完成本地测试,可以正常获取文章内容和日期

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: 48721b61

@github-actions github-actions bot added the Auto: Route Test Complete Auto route test has finished on given PR label Jan 22, 2025
Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: bcdcd362

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: e481031d

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: 356e8a37

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: 6a94f476

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: 2fcd3217

Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: ff4af1c5


export default async function darioamodeiHandler(ctx) {
const rootUrl = 'https://darioamodei.com';

Check failure

Code scanning / ESLint

Disallow trailing whitespace at the end of lines Error

Trailing spaces not allowed.
Comment on lines +12 to +29
const items = $('.essay')
.map((_, essay) => {
const $essay = $(essay);
const $title = $essay.find('h3');
const $link = $essay.find('a').first();
const dateStr = $essay.find('span').first().text().trim();
// 获取文章详情页
const articleUrl = new URL($link.attr('href'), rootUrl).href;
return {
title: $title.text().trim(),
link: articleUrl,
// 暂时使用文章预览作为描述,后续可以抓取详情页获取完整内容
description: $essay.find('p').text().trim(),
// 解析日期,格式如 "March 2024"
pubDate: parseDate(dateStr, 'MMMM YYYY'),
};
})
.toArray();

Check warning

Code scanning / ESLint

Disallow specified syntax Warning

Please use .toArray() before .map().
Copy link
Contributor

Successfully generated as following:

http://localhost:1200/darioamodei - Failed ❌
HTTPError: Response code 404 (Not Found)

Error Message:<br/>NotFoundError: The route does not exist or has been deleted.
Route: /darioamodei
Full Route: /darioamodei
Node Version: v22.13.0
Git Hash: de819506

Copy link
Contributor

This PR is stale because it has been opened for more than 3 weeks with no activity. Comment or this will be closed in 7 days.

@github-actions github-actions bot added Stale No feedback from OP and removed Stale No feedback from OP labels Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant