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 中找到']"/>
|
<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
|
## 爱范儿 ifanr
|
||||||
|
|
||||||
### 爱范儿频道
|
### 爱范儿频道
|
||||||
|
|||||||
@@ -1215,7 +1215,7 @@ router.get('/checkee/:dispdate', require('./routes/checkee/index'));
|
|||||||
router.get('/iresearch/report', require('./routes/iresearch/report'));
|
router.get('/iresearch/report', require('./routes/iresearch/report'));
|
||||||
|
|
||||||
// ZAKER
|
// ZAKER
|
||||||
router.get('/zaker/source/:id', require('./routes/zaker/source'));
|
router.get('/zaker/:type/:id', require('./routes/zaker/source'));
|
||||||
|
|
||||||
// Matters
|
// Matters
|
||||||
router.get('/matters/topics', require('./routes/matters/topics'));
|
router.get('/matters/topics', require('./routes/matters/topics'));
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ const cheerio = require('cheerio');
|
|||||||
const date_util = require('@/utils/date');
|
const date_util = require('@/utils/date');
|
||||||
|
|
||||||
module.exports = async (ctx) => {
|
module.exports = async (ctx) => {
|
||||||
|
const type = ctx.params.type || 'source';
|
||||||
const id = ctx.params.id;
|
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 response = await got.get(link);
|
||||||
const $ = cheerio.load(response.data);
|
const $ = cheerio.load(response.data);
|
||||||
@@ -40,10 +41,13 @@ module.exports = async (ctx) => {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
headers: {
|
headers: {
|
||||||
Referer: link,
|
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);
|
const $ = cheerio.load(response.data);
|
||||||
|
$('img').each((index, elem) => {
|
||||||
|
const $elem = $(elem);
|
||||||
|
$elem.attr('referrerpolicy', 'no-referrer');
|
||||||
|
});
|
||||||
const description = $('div.article_content div')
|
const description = $('div.article_content div')
|
||||||
.html()
|
.html()
|
||||||
.replace(/data-original/g, `src`);
|
.replace(/data-original/g, `src`);
|
||||||
|
|||||||
Reference in New Issue
Block a user