feat: add MIT Technology Review (#5975)
This commit is contained in:
parent
8535d6fa2b
commit
77b5ceec08
|
|
@ -88,6 +88,27 @@ The parameter id in the route is the id in the URL of the user ’s Google Schol
|
|||
|
||||
</RouteEn>
|
||||
|
||||
## MIT Technology Review
|
||||
|
||||
<RouteEn author="laampui" example="/technologyreview/humans-and-technology" path="/technologyreview/:category_name" :paramsDesc="['see below']" />
|
||||
|
||||
|
||||
|
||||
| `:category_name` | Route |
|
||||
| -------- | ----- |
|
||||
| humans-and-technology | /technologyreview/humans-and-technology |
|
||||
| election-2020 | /technologyreview/election-2020 |
|
||||
| artificial-intelligence | /technologyreview/artificial-intelligence |
|
||||
| biotechnology | /technologyreview/biotechnology |
|
||||
| blockchain | /technologyreview/blockchain |
|
||||
| climate-change | /technologyreview/climate-change |
|
||||
| computing |/technologyreview/computing |
|
||||
| tech-policy | /technologyreview/tech-policy |
|
||||
| silicon-valley | /technologyreview/silicon-valley|
|
||||
| smart-cities | /technologyreview/smart-cities|
|
||||
| space | /technologyreview/space |
|
||||
|
||||
|
||||
## Nature Journal
|
||||
|
||||
### Latest Research
|
||||
|
|
|
|||
|
|
@ -477,6 +477,8 @@ router.get('/oschina/user/:id', require('./routes/oschina/user'));
|
|||
router.get('/oschina/u/:id', require('./routes/oschina/u'));
|
||||
router.get('/oschina/topic/:topic', require('./routes/oschina/topic'));
|
||||
|
||||
// MIT technology review
|
||||
router.get('/technologyreview/:category_name', require('./routes/technologyreview/topic'));
|
||||
// 安全客
|
||||
router.get('/aqk/vul', require('./routes/aqk/vul'));
|
||||
router.get('/aqk/:category', require('./routes/aqk/category'));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
ctx.params.category_name = ctx.params.category_name || 'humans-and-technology';
|
||||
|
||||
const response = await got.get(`https://wp.technologyreview.com/wp-json/irving/v1/data/term_archive?page=1&category_name=${ctx.params.category_name}`);
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'Technology Review',
|
||||
link: 'https://www.technologyreview.com/',
|
||||
item: response.data.map((item) => ({
|
||||
title: item.config.title,
|
||||
description: item.config.postDate,
|
||||
link: item.config.permalink,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue