mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-08 14:07:54 +08:00
@@ -103,3 +103,7 @@
|
||||
|
||||
<Route name="分类筛选" author="MegrezZhu" example="/nhentai/language/chinese" path="/nhentai/:key/:keyword/:mode?" :paramsDesc="['筛选条件,可选: parody, character, tag, artist, group, language, category','筛选值', '模式,`simple`为仅封面,`detail`会包括本子每一页,但对服务器负载大。默认为`simple`']" />
|
||||
<Route name="高级搜索" author="MegrezZhu" example="/nhentai/search/language%3Ajapanese+-scat+-yaoi+-guro+-%22mosaic+censorship%22" path="/nhentai/search/:keyword/:mode?" :paramsDesc="['用于搜索的关键词。可在原网站搜索后复制 q= 后面的内容,也可直接输入,但空格等特殊符号是否会转换取决于浏览器和阅读器的实现。用法详见[官网](https://nhentai.net/info/)', '模式,`simple`为仅封面,`detail`会包括本子每一页,但对服务器负载大。默认为`simple`']" />
|
||||
|
||||
## 国家地理
|
||||
|
||||
<Route name="每日一图" author="LogicJake" example="/natgeo/dailyphoto" path="/natgeo/dailyphoto"/>
|
||||
|
||||
@@ -413,6 +413,7 @@ router.get('/sexinsex/:id/:type?', require('./routes/sexinsex/index'));
|
||||
router.get('/gcores/category/:category', require('./routes/gcores/category'));
|
||||
|
||||
// 国家地理
|
||||
router.get('/natgeo/dailyphoto', require('./routes/natgeo/dailyphoto'));
|
||||
router.get('/natgeo/:cat/:type?', require('./routes/natgeo/natgeo'));
|
||||
|
||||
// 一个
|
||||
|
||||
27
lib/routes/natgeo/dailyphoto.js
Normal file
27
lib/routes/natgeo/dailyphoto.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const axios = require('../../utils/axios');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const today = new Date();
|
||||
const year = today.getFullYear();
|
||||
const month = today.getMonth() + 1;
|
||||
|
||||
const api = `https://www.nationalgeographic.com/content/photography/en_US/photo-of-the-day/_jcr_content/.gallery.${year}-${month}.json`;
|
||||
const response = await axios.get(api);
|
||||
const items = response.data.items;
|
||||
|
||||
const out = items.slice(0, 10).map((item) => {
|
||||
const info = {
|
||||
title: item.altText,
|
||||
author: item.credit,
|
||||
link: item['full-path-url'],
|
||||
description: `<img referrerpolicy="no-referrer" src="${item.sizes[1024]}">` + item.caption,
|
||||
};
|
||||
return info;
|
||||
});
|
||||
|
||||
ctx.state.data = {
|
||||
title: 'Photo of the Day',
|
||||
link: 'https://www.nationalgeographic.com/photography/photo-of-the-day/',
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user