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(route): add cffex/announcement #16258

Merged
merged 2 commits into from
Jul 26, 2024
Merged

feat(route): add cffex/announcement #16258

merged 2 commits into from
Jul 26, 2024

Conversation

ChenXiangcheng1
Copy link
Contributor

@ChenXiangcheng1 ChenXiangcheng1 commented Jul 25, 2024

Involved Issue / 该 PR 相关 Issue

N/A

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

/cffex/announcement

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 / 说明

我的第一个 PR !!!


export const route: Route = {
path: '/announcement',
name: '中国金融期货交易所 - 交易所公告',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: '中国金融期货交易所 - 交易所公告',
name: '交易所公告',

Do not include namespace's name in route name

maintainers: ['ChenXiangcheng1'],
example: '/cffex/announcement',
parameters: {},
description: `欢迎订阅!!! 我维护的 cffex 交易所公告!!! `,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: `欢迎订阅!!! 我维护的 cffex 交易所公告!!! `,

radar: [
{
source: ['cffex.com.cn'],
target: '/cffex/announcement',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
target: '/cffex/announcement',
target: '/announcement',

Comment on lines 37 to 39
const response = await ofetch(homeUrl, {
headers: {},
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const response = await ofetch(homeUrl, {
headers: {},
});
const response = await ofetch(homeUrl);

Comment on lines 47 to 48
const a1 = $(item).find('a').first();
const a2 = $(item).find('a').eq(1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use descriptive variables

item.description = $('div.jysggnr div.nan p').eq(1)?.html();
return item;
},
3600,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the default config.cache.contentExpire instead of a hard-coded value.

return item;
},
3600,
true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to specify the default value

);

return {
title: `中国金融期货交易所 - 交易所公告`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: `中国金融期货交易所 - 交易所公告`,
title: '中国金融期货交易所 - 交易所公告',

@ChenXiangcheng1
Copy link
Contributor Author

Route test
Unhandled error: TypeError: fetch failed

it works well locally.
Is this due to network problems?

@TonyRL TonyRL merged commit 1728ea5 into DIYgod:master Jul 26, 2024
27 checks passed
wonktondI pushed a commit to wonktondI/RSSHub that referenced this pull request Jul 28, 2024
* feat(route): add cffex/announcement

* style(route/cffex): modify code style
@ChenXiangcheng1 ChenXiangcheng1 deleted the dev branch July 29, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants