mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-05 12:21:31 +08:00
30 lines
698 B
JavaScript
30 lines
698 B
JavaScript
const axios = require('@/utils/axios');
|
|
const utils = require('./utils');
|
|
|
|
module.exports = async (ctx) => {
|
|
const apiUrl = 'https://www.infoq.cn/public/v1/my/recommond';
|
|
const pageUrl = 'https://www.infoq.cn';
|
|
|
|
const resp = await axios({
|
|
method: 'post',
|
|
url: apiUrl,
|
|
headers: {
|
|
Referer: pageUrl,
|
|
'Content-Type': 'application/json',
|
|
},
|
|
data: {
|
|
size: 5,
|
|
},
|
|
});
|
|
|
|
const data = resp.data.data;
|
|
const items = await utils.ProcessFeed(data, ctx.cache);
|
|
|
|
ctx.state.data = {
|
|
title: 'InfoQ推荐',
|
|
link: pageUrl,
|
|
description: 'InfoQ推荐',
|
|
item: items,
|
|
};
|
|
};
|