mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 14:40:23 +08:00
feat: add zaker channel (#2550)
* feat: add zaker channel * feat: add zaker channel * feat: add zaker channel
This commit is contained in:
@@ -256,6 +256,10 @@ type 为 all 时,category 参数不支持 cost 和 free
|
||||
|
||||
<Route author="LogicJake" example="/zaker/source/12291" path="/zaker/source/:id" :paramsDesc="['source id,可在 URL 中找到']"/>
|
||||
|
||||
### channel
|
||||
|
||||
<Route author="kt286" example="/zaker/channel/13" path="/zaker/source/:id" :paramsDesc="['channel id,可在 URL 中找到']"/>
|
||||
|
||||
## 爱范儿 ifanr
|
||||
|
||||
### 爱范儿频道
|
||||
|
||||
@@ -1215,7 +1215,7 @@ router.get('/checkee/:dispdate', require('./routes/checkee/index'));
|
||||
router.get('/iresearch/report', require('./routes/iresearch/report'));
|
||||
|
||||
// ZAKER
|
||||
router.get('/zaker/source/:id', require('./routes/zaker/source'));
|
||||
router.get('/zaker/:type/:id', require('./routes/zaker/source'));
|
||||
|
||||
// Matters
|
||||
router.get('/matters/topics', require('./routes/matters/topics'));
|
||||
|
||||
@@ -3,8 +3,9 @@ const cheerio = require('cheerio');
|
||||
const date_util = require('@/utils/date');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const type = ctx.params.type || 'source';
|
||||
const id = ctx.params.id;
|
||||
const link = `http://www.myzaker.com/source/${id}`;
|
||||
const link = `http://www.myzaker.com/${type}/${id}`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
@@ -40,10 +41,13 @@ module.exports = async (ctx) => {
|
||||
method: 'get',
|
||||
headers: {
|
||||
Referer: link,
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0',
|
||||
},
|
||||
});
|
||||
const $ = cheerio.load(response.data);
|
||||
$('img').each((index, elem) => {
|
||||
const $elem = $(elem);
|
||||
$elem.attr('referrerpolicy', 'no-referrer');
|
||||
});
|
||||
const description = $('div.article_content div')
|
||||
.html()
|
||||
.replace(/data-original/g, `src`);
|
||||
|
||||
Reference in New Issue
Block a user