feat(route): Added TheVerge Hubs (#11276)
* Added TheVerge Hubs https://www.theverge.com/2012/1/25/2732963/verge-rss-feeds * Fixed Lint warnings * Fixed string quotes * Updated maintainer and radar * Updated the docs * Update docs/en/new-media.md * Update docs/new-media.md * Update lib/v2/theverge/maintainer.js * docs: fix typo
This commit is contained in:
parent
493b2baafa
commit
4fa3faa597
|
|
@ -764,7 +764,22 @@ Compared to the official one, this feed:
|
|||
|
||||
### The Verge
|
||||
|
||||
<RouteEn author="HenryQW" example="/theverge" path="/theverge">
|
||||
<RouteEn author="HenryQW vbali" example="/theverge" path="/theverge/:hub? :paramsDesc="['Hub, see below, All Posts by default']">
|
||||
|
||||
| Hub | Hub name |
|
||||
| ----------- | ------------------- |
|
||||
| | All Posts |
|
||||
| android | Android |
|
||||
| apple | Apple |
|
||||
| apps | Apps & Software |
|
||||
| blackberry | BlackBerry |
|
||||
| culture | Culture |
|
||||
| gaming | Gaming |
|
||||
| hd | HD & Home |
|
||||
| microsoft | Microsoft |
|
||||
| photography | Photography & Video |
|
||||
| policy | Policy & Law |
|
||||
| web | Web & Social |
|
||||
|
||||
Provides a better reading experience (full text articles) over the official one.
|
||||
|
||||
|
|
|
|||
|
|
@ -1359,7 +1359,22 @@ IPFS 网关有可能失效,那时候换成其他网关。
|
|||
|
||||
### The Verge
|
||||
|
||||
<Route author="HenryQW" example="/theverge" path="/theverge">
|
||||
<Route author="HenryQW vbali" example="/theverge" path="/theverge/:hub?" :paramsDesc="['枢纽,见下表,默认为 All Posts']">
|
||||
|
||||
| Hub | Hub name |
|
||||
| ----------- | ------------------- |
|
||||
| | All Posts |
|
||||
| android | Android |
|
||||
| apple | Apple |
|
||||
| apps | Apps & Software |
|
||||
| blackberry | BlackBerry |
|
||||
| culture | Culture |
|
||||
| gaming | Gaming |
|
||||
| hd | HD & Home |
|
||||
| microsoft | Microsoft |
|
||||
| photography | Photography & Video |
|
||||
| policy | Policy & Law |
|
||||
| web | Web & Social |
|
||||
|
||||
通过提取文章全文,以提供比官方源更佳的阅读体验.
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,15 @@ const parser = require('@/utils/rss-parser');
|
|||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const feed = await parser.parseURL('https://www.theverge.com/rss/index.xml');
|
||||
let link;
|
||||
|
||||
if (ctx.params.hub) {
|
||||
link = `https://www.theverge.com/${ctx.params.hub}/rss/index.xml`;
|
||||
} else {
|
||||
link = 'https://www.theverge.com/rss/index.xml';
|
||||
}
|
||||
|
||||
const feed = await parser.parseURL(link);
|
||||
|
||||
const items = await Promise.all(
|
||||
feed.items.map((item) =>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = {
|
||||
'/': ['HenryQW'],
|
||||
'/:hub?': ['HenryQW', 'vbali'],
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ module.exports = {
|
|||
{
|
||||
title: 'The Verge',
|
||||
docs: 'https://docs.rsshub.app/new-media.html#the-verge',
|
||||
source: ['/rss/index.xml', '/'],
|
||||
target: '/theverge',
|
||||
source: ['/:hub', '/'],
|
||||
target: '/theverge/:hub?',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
module.exports = (router) => {
|
||||
router.get('/', require('./index'));
|
||||
router.get('/:hub?', require('./index'));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue