style: auto format
This commit is contained in:
@@ -394,6 +394,12 @@ Compared to the official one, this feed:
|
||||
|
||||
<RouteEn author="kt286" example="/sixthtone/news" path="/sixthtone/news"/>
|
||||
|
||||
## Sky Sports
|
||||
|
||||
### News
|
||||
|
||||
<RouteEn author="nczitzk" example="/skysports/news/ac-milan" path="/skysports/news/:team" :paramsDesc="['Team id, can be found in URL to the team page']" />\
|
||||
|
||||
## Soomal
|
||||
|
||||
### 话题
|
||||
@@ -420,12 +426,6 @@ Compared to the official one, this feed:
|
||||
|
||||
</RouteEn>
|
||||
|
||||
## Sky Sports
|
||||
|
||||
### News
|
||||
|
||||
<RouteEn author="nczitzk" example="/skysports/news/ac-milan" path="/skysports/news/:team" :paramsDesc="['Team id, can be found in URL to the team page']" />\
|
||||
|
||||
## The Brain
|
||||
|
||||
### Blog
|
||||
|
||||
+18
-18
@@ -609,6 +609,12 @@ IPFS 网关有可能失效,那时候换成其他网关。
|
||||
|
||||
<Route author="kt286" example="/sixthtone/news" path="/sixthtone/news"/>
|
||||
|
||||
## Sky Sports
|
||||
|
||||
### News
|
||||
|
||||
<Route author="nczitzk" example="/skysports/news/ac-milan" path="/skysports/news/:team" :paramsDesc="['球队 id,可在球队对应页面的 URL 中找到']" />
|
||||
|
||||
## SocialBeta
|
||||
|
||||
### 首页
|
||||
@@ -645,12 +651,6 @@ IPFS 网关有可能失效,那时候换成其他网关。
|
||||
|
||||
</Route>
|
||||
|
||||
## Sky Sports
|
||||
|
||||
### News
|
||||
|
||||
<Route author="nczitzk" example="/skysports/news/ac-milan" path="/skysports/news/:team" :paramsDesc="['球队 id,可在球队对应页面的 URL 中找到']" />
|
||||
|
||||
## TANC 艺术新闻
|
||||
|
||||
### 分类
|
||||
@@ -2532,18 +2532,6 @@ column 为 third 时可选的 category:
|
||||
|
||||
</Route>
|
||||
|
||||
## 中国计算机学会
|
||||
|
||||
### 新闻
|
||||
|
||||
<Route author="nczitzk" example="/ccf/news" path="/ccf/news/:category?" :paramsDesc="['分类,见下表,默认为 CCF 新闻']">
|
||||
|
||||
| CCF 新闻 | CCF 聚焦 | ACM 信息 |
|
||||
| ---------- | -------- | -------- |
|
||||
| Media_list | Focus | ACM_News |
|
||||
|
||||
</Route>
|
||||
|
||||
## 中国机械工程学会
|
||||
|
||||
### 学会新闻
|
||||
@@ -2568,6 +2556,18 @@ column 为 third 时可选的 category:
|
||||
|
||||
</Route>
|
||||
|
||||
## 中国计算机学会
|
||||
|
||||
### 新闻
|
||||
|
||||
<Route author="nczitzk" example="/ccf/news" path="/ccf/news/:category?" :paramsDesc="['分类,见下表,默认为 CCF 新闻']">
|
||||
|
||||
| CCF 新闻 | CCF 聚焦 | ACM 信息 |
|
||||
| ---------- | -------- | -------- |
|
||||
| Media_list | Focus | ACM_News |
|
||||
|
||||
</Route>
|
||||
|
||||
## 中国科学院青年创新促进会
|
||||
|
||||
### 最新博文
|
||||
|
||||
@@ -26,22 +26,22 @@ module.exports = async (ctx) => {
|
||||
.get();
|
||||
|
||||
const items = await Promise.all(
|
||||
list.map(
|
||||
(item) => ctx.cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link,
|
||||
});
|
||||
list.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const detailResponse = await got({
|
||||
method: 'get',
|
||||
url: item.link,
|
||||
});
|
||||
|
||||
const content = cheerio.load(detailResponse.data);
|
||||
const content = cheerio.load(detailResponse.data);
|
||||
|
||||
content('.sdc-article-widget, .sdc-site-layout-sticky-region').remove();
|
||||
content('.sdc-article-widget, .sdc-site-layout-sticky-region').remove();
|
||||
|
||||
item.description = content('.sdc-article-body').html();
|
||||
item.pubDate = parseDate(detailResponse.data.match(/"datePublished": "(.*)","dateModified"/)[1]);
|
||||
item.description = content('.sdc-article-body').html();
|
||||
item.pubDate = parseDate(detailResponse.data.match(/"datePublished": "(.*)","dateModified"/)[1]);
|
||||
|
||||
return item;
|
||||
})
|
||||
return item;
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ const generateResponse = async (items) => ({
|
||||
})),
|
||||
});
|
||||
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
// 根据不同用户瞬间会得到不同的结果,这里提供一些例子
|
||||
const defaultPid = 'NXJiSlM5V21kamJWVlgvZUh1NEExdz09';
|
||||
@@ -69,7 +68,7 @@ module.exports = async (ctx) => {
|
||||
allItems.push(...items);
|
||||
});
|
||||
|
||||
const uniqAllItems = allItems.filter((value, idx, arr) => arr.findIndex((item) => (item.pId === value.pId)) === idx);
|
||||
const uniqAllItems = allItems.filter((value, idx, arr) => arr.findIndex((item) => item.pId === value.pId) === idx);
|
||||
|
||||
ctx.state.data = await generateResponse(uniqAllItems);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user