style: auto format
This commit is contained in:
parent
4cd0bd2082
commit
ab24f40d7a
|
|
@ -992,6 +992,15 @@ IT・科学 tech_science
|
|||
|
||||
</Route>
|
||||
|
||||
## 法国广播电台
|
||||
|
||||
### 地缘政治栏目
|
||||
|
||||
<Route author="xdu" example="/radiofrance/geopolitique" path="/radiofrance/geopolitique">
|
||||
|
||||
法广电台地缘政治栏目最新 3 篇文章全文抓取,提供比官方源更佳的阅读体验。
|
||||
|
||||
</Route>
|
||||
## 公視新聞網
|
||||
|
||||
### 即時新聞
|
||||
|
|
@ -2706,13 +2715,3 @@ category 对应的关键词有
|
|||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|
||||
|
||||
</Route>
|
||||
|
||||
## 法国广播电台
|
||||
|
||||
### 地缘政治栏目
|
||||
|
||||
<Route author="xdu" example="/radiofrance/geopolitique" path="/radiofrance/geopolitique">
|
||||
|
||||
法广电台地缘政治栏目最新3篇文章全文抓取,提供比官方源更佳的阅读体验。
|
||||
|
||||
</Route>
|
||||
|
|
@ -4,29 +4,30 @@ const parser = require('@/utils/rss-parser');
|
|||
const { art } = require('@/utils/render');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const feed = await parser.parseURL('https://radiofrance-podcast.net/podcast09/rss_10009.xml');
|
||||
const feed = await parser.parseURL('https://radiofrance-podcast.net/podcast09/rss_10009.xml');
|
||||
|
||||
const items = await Promise.all(
|
||||
// only retrieve the full text for the first 3 items
|
||||
feed.items.slice(0, 3)
|
||||
.map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const uri = item.link.slice(item.link.indexOf('/franceinter'));
|
||||
const apiurl = 'https://www.radiofrance.fr/api/v2.1/path?value=' + encodeURIComponent(uri);
|
||||
const { data } = await got(apiurl);
|
||||
const items = await Promise.all(
|
||||
// only retrieve the full text for the first 3 items
|
||||
feed.items.slice(0, 3).map((item) =>
|
||||
ctx.cache.tryGet(item.link, async () => {
|
||||
const uri = item.link.slice(item.link.indexOf('/franceinter'));
|
||||
const apiurl = 'https://www.radiofrance.fr/api/v2.1/path?value=' + encodeURIComponent(uri);
|
||||
const { data } = await got(apiurl);
|
||||
|
||||
delete item.content;
|
||||
delete item.contentSnippet;
|
||||
delete item.content;
|
||||
delete item.contentSnippet;
|
||||
|
||||
item.description = art(path.join(__dirname, 'templates/article.art'), data.content);
|
||||
return item;
|
||||
})));
|
||||
item.description = art(path.join(__dirname, 'templates/article.art'), data.content);
|
||||
return item;
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
ctx.state.data = {
|
||||
title: feed.title,
|
||||
link: feed.link,
|
||||
description: feed.description,
|
||||
item: items,
|
||||
language: feed.language,
|
||||
};
|
||||
ctx.state.data = {
|
||||
title: feed.title,
|
||||
link: feed.link,
|
||||
description: feed.description,
|
||||
item: items,
|
||||
language: feed.language,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = {
|
||||
'/geopolitique': ['xdu'],
|
||||
'/geopolitique': ['xdu'],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
module.exports = {
|
||||
'radiofrance.fr': {
|
||||
_name: 'Radio France',
|
||||
'www': [
|
||||
{
|
||||
title: 'Géopolitique',
|
||||
docs: 'https://docs.rsshub.app/traditional-media.html#fa-guo-guang-bo-dian-tai',
|
||||
source: ['/franceinter/podcasts/geopolitique', '/'],
|
||||
target: '/radiofrance/geopolitique',
|
||||
},
|
||||
],
|
||||
},
|
||||
'radiofrance.fr': {
|
||||
_name: 'Radio France',
|
||||
www: [
|
||||
{
|
||||
title: 'Géopolitique',
|
||||
docs: 'https://docs.rsshub.app/traditional-media.html#fa-guo-guang-bo-dian-tai',
|
||||
source: ['/franceinter/podcasts/geopolitique', '/'],
|
||||
target: '/radiofrance/geopolitique',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = (router) => {
|
||||
router.get('/geopolitique', require('./geopolitique'));
|
||||
router.get('/geopolitique', require('./geopolitique'));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue