diff --git a/docs/traditional-media.md b/docs/traditional-media.md index 3ec2e8caf0..1f1842dca9 100644 --- a/docs/traditional-media.md +++ b/docs/traditional-media.md @@ -213,3 +213,7 @@ category 对应的关键词有 ## 21 财经 + +## The Economist + + diff --git a/lib/router.js b/lib/router.js index 8ed64908b7..205e54fa4e 100755 --- a/lib/router.js +++ b/lib/router.js @@ -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; diff --git a/lib/routes/the-economist/gre-vocabulary.js b/lib/routes/the-economist/gre-vocabulary.js new file mode 100644 index 0000000000..680f3f50a8 --- /dev/null +++ b/lib/routes/the-economist/gre-vocabulary.js @@ -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: ` +
+ Source: ${wordInfo.sourceTitle} + `, + pubDate: new Date(time).toUTCString(), + link: wordInfo.url, + }, + ], + }; +};