-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Conversation
lib/routes/cffex/announcement.ts
Outdated
|
||
export const route: Route = { | ||
path: '/announcement', | ||
name: '中国金融期货交易所 - 交易所公告', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: '中国金融期货交易所 - 交易所公告', | |
name: '交易所公告', |
Do not include namespace's name in route name
lib/routes/cffex/announcement.ts
Outdated
maintainers: ['ChenXiangcheng1'], | ||
example: '/cffex/announcement', | ||
parameters: {}, | ||
description: `欢迎订阅!!! 我维护的 cffex 交易所公告!!! `, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: `欢迎订阅!!! 我维护的 cffex 交易所公告!!! `, |
lib/routes/cffex/announcement.ts
Outdated
radar: [ | ||
{ | ||
source: ['cffex.com.cn'], | ||
target: '/cffex/announcement', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target: '/cffex/announcement', | |
target: '/announcement', |
lib/routes/cffex/announcement.ts
Outdated
const response = await ofetch(homeUrl, { | ||
headers: {}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const response = await ofetch(homeUrl, { | |
headers: {}, | |
}); | |
const response = await ofetch(homeUrl); |
lib/routes/cffex/announcement.ts
Outdated
const a1 = $(item).find('a').first(); | ||
const a2 = $(item).find('a').eq(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use descriptive variables
lib/routes/cffex/announcement.ts
Outdated
item.description = $('div.jysggnr div.nan p').eq(1)?.html(); | ||
return item; | ||
}, | ||
3600, |
There was a problem hiding this comment.
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.
lib/routes/cffex/announcement.ts
Outdated
return item; | ||
}, | ||
3600, | ||
true |
There was a problem hiding this comment.
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
lib/routes/cffex/announcement.ts
Outdated
); | ||
|
||
return { | ||
title: `中国金融期货交易所 - 交易所公告`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title: `中国金融期货交易所 - 交易所公告`, | |
title: '中国金融期货交易所 - 交易所公告', |
Route test it works well locally. |
* feat(route): add cffex/announcement * style(route/cffex): modify code style
Involved Issue / 该 PR 相关 Issue
N/A
Example for the Proposed Route(s) / 路由地址示例
New RSS Route Checklist / 新 RSS 路由检查表
Puppeteer
Note / 说明
我的第一个 PR !!!