Files
RSSHub/lib/v2/byteclicks/index.js
Tony 4567e3a6eb feat(route): byteclicks (#11743)
* feat(route): byteclicks

* docs: fix paramsDesc
2023-02-01 03:21:54 +08:00

23 lines
1006 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const got = require('@/utils/got');
const { parseItem } = require('./utils');
const baseUrl = 'https://byteclicks.com';
module.exports = async (ctx) => {
const { data } = await got(`${baseUrl}/wp-json/wp/v2/posts`, {
searchParams: {
per_page: ctx.query.limit ? parseInt(ctx.query.limit) : 100,
},
});
const items = parseItem(data);
ctx.state.data = {
title: '字节点击 - 聚合全球优质资源,跟踪世界前沿科技',
description:
'byteclicks.com 最专业的前沿科技网站。聚合全球优质资源跟踪世界前沿科技精选推荐一些很棒的互联网好资源好工具好产品。寻找有前景好项目、找论文、找报告、找数据、找课程、找电子书上byteclicksbyteclicks.com是投资人、科研学者、学生每天必看的网站。',
image: 'https://byteclicks.com/wp-content/themes/RK-Blogger/images/wbolt.ico',
link: baseUrl,
item: items,
};
};