mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
@@ -298,6 +298,12 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
||||
|
||||
<Route author="maple3142" example="/facebook/page/SonetPCR" path="/facebook/page/:id" :paramsDesc="['專頁 id']" anticrawler="1"/>
|
||||
|
||||
## iCity
|
||||
|
||||
### 用户动态
|
||||
|
||||
<Route author="nczitzk" example="/icity/sai" path="/icity/:id" :paramsDesc="['用户 id']"/>
|
||||
|
||||
## Keep
|
||||
|
||||
### 运动日记
|
||||
|
||||
@@ -3260,6 +3260,9 @@ router.get('/appsales/:caty?/:time?', require('./routes/appsales/index'));
|
||||
// CGTN
|
||||
router.get('/cgtn/top', require('./routes/cgtn/top'));
|
||||
|
||||
// iCity
|
||||
router.get('/icity/:id', require('./routes/icity/index'));
|
||||
|
||||
// Anki
|
||||
router.get('/anki/changes', require('./routes/anki/changes'));
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const rootUrl = `https://icity.ly/u/${ctx.params.id}`;
|
||||
const response = await got({
|
||||
method: 'get',
|
||||
url: rootUrl,
|
||||
});
|
||||
|
||||
const $ = cheerio.load(response.data);
|
||||
const items = $('li.diary')
|
||||
.map((_, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
link: rootUrl,
|
||||
title: item.prev('li.day-cut').text(),
|
||||
description: item.find('div.line').html(),
|
||||
pubDate: new Date(item.find('time.hours').attr('datetime')).toUTCString(),
|
||||
};
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: $('title').text(),
|
||||
link: rootUrl,
|
||||
item: items,
|
||||
description: $('div.bio').text(),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user