mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 06:30:40 +08:00
Add: the-economist gre (#2043)
* Add /the-economist/gre-vocabulary * 原来有接口 = = * 忘了写文档 = =
This commit is contained in:
@@ -213,3 +213,7 @@ category 对应的关键词有
|
||||
## 21 财经
|
||||
|
||||
<Route name="频道" author="brilon" example="/21caijing/channel/readnumber" path="/21caijing/channel/:name" :paramsDesc="['频道名称,可在[https://m.21jingji.com/](https://m.21jingji.com/)页面URL中找到']"/>
|
||||
|
||||
## The Economist
|
||||
|
||||
<Route name="GRE Vocabulary" author="xyqfer" example="/the-economist/gre-vocabulary" path="/the-economist/gre-vocabulary" />
|
||||
|
||||
@@ -1306,4 +1306,7 @@ router.get('/saraba1st/thread/:tid', require('./routes/saraba1st/thread'));
|
||||
router.get('/gradcafe/result/:type', require('./routes/gradcafe/result'));
|
||||
router.get('/gradcafe/result', require('./routes/gradcafe/result'));
|
||||
|
||||
// The Economist
|
||||
router.get('/the-economist/gre-vocabulary', require('./routes/the-economist/gre-vocabulary'));
|
||||
|
||||
module.exports = router;
|
||||
|
||||
27
lib/routes/the-economist/gre-vocabulary.js
Normal file
27
lib/routes/the-economist/gre-vocabulary.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const axios = require('../../utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
url: 'https://gre.economist.com/api/gre-vocabulary.json',
|
||||
});
|
||||
|
||||
const wordInfo = response.data[0];
|
||||
const time = wordInfo.publishedDate;
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'The Economist GRE Vocabulary',
|
||||
link: 'https://gre.economist.com/gre-vocabulary',
|
||||
item: [
|
||||
{
|
||||
title: `${wordInfo.word} - ${time}`,
|
||||
description: `
|
||||
<img referrerpolicy="no-referrer" src="${wordInfo.image.url}"><br>
|
||||
Source: <a href="${wordInfo.sourceUrl}">${wordInfo.sourceTitle}</a>
|
||||
`,
|
||||
pubDate: new Date(time).toUTCString(),
|
||||
link: wordInfo.url,
|
||||
},
|
||||
],
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user