mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-07 21:47:57 +08:00
@@ -3178,6 +3178,16 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
|
||||
<route name="用户" author="SettingDust" example="/uraaka-joshi/_rrwq" path="/uraaka-joshi/:id" :paramsDesc="['用户名']"/>
|
||||
|
||||
### 西祠胡同
|
||||
|
||||
<route name="频道" author="LogicJake" example="/xici" path="/xici/:id?" :paramsDesc="['频道id,默认为首页推荐']">
|
||||
|
||||
| 首页推荐 | 民生 | 情感 | 亲子 |
|
||||
| -------- | ---- | ---- | ---- |
|
||||
| (空) | ms | qg | qz |
|
||||
|
||||
</route>
|
||||
|
||||
### 今日热榜
|
||||
|
||||
<route name="榜单" author="LogicJake" example="/tophub/Om4ejxvxEN" path="/tophub/:id" :paramsDesc="['榜单id,可在 URL 中找到']"/>
|
||||
|
||||
@@ -1150,6 +1150,9 @@ router.get('/blogs/jingwei.link', require('./routes/blogs/jingwei_link'));
|
||||
router.get('/uraaka-joshi', require('./routes/uraaka-joshi/uraaka-joshi'));
|
||||
router.get('/uraaka-joshi/:id', require('./routes/uraaka-joshi/uraaka-joshi-user'));
|
||||
|
||||
// 西祠胡同
|
||||
router.get('/xici/:id?', require('./routes/xici'));
|
||||
|
||||
// 今日热榜
|
||||
router.get('/tophub/:id', require('./routes/tophub'));
|
||||
|
||||
|
||||
43
lib/routes/xici/index.js
Normal file
43
lib/routes/xici/index.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const axios = require('../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
const url = require('url');
|
||||
|
||||
const host = 'http://www.xici.net/t/';
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id || '..';
|
||||
|
||||
const link = url.resolve(host, id);
|
||||
const response = await axios.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
const title = $('a.actived').text();
|
||||
const out = $('ul.feed-list li[data-score]')
|
||||
.slice(0, 10)
|
||||
.map(function() {
|
||||
const info = {
|
||||
title: $(this)
|
||||
.find('div.title a')
|
||||
.text(),
|
||||
link:
|
||||
'http:' +
|
||||
$(this)
|
||||
.find('div.title a')
|
||||
.attr('href'),
|
||||
pubDate: $(this)
|
||||
.find('span.time')
|
||||
.attr('data-timeago'),
|
||||
author: $(this)
|
||||
.find('a.board-link')
|
||||
.text(),
|
||||
};
|
||||
return info;
|
||||
})
|
||||
.get();
|
||||
|
||||
ctx.state.data = {
|
||||
title: `${title}-西祠胡同`,
|
||||
link: link,
|
||||
item: out,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user