mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-18 14:29:01 +08:00
d9332c2bae
* feat(route): add 纪妖 * fix: use wordpress restapi * update lib/v2/cbaigui/index.js ---------
19 lines
453 B
JavaScript
19 lines
453 B
JavaScript
const got = require('@/utils/got');
|
|
|
|
const rootUrl = 'https://cbaigui.com';
|
|
const apiSlug = 'wp-json/wp/v2';
|
|
|
|
const GetFilterId = async (type, name) => {
|
|
const filterApiUrl = new URL(`${apiSlug}/${type}?search=${name}`, rootUrl).href;
|
|
|
|
const { data: filterResponse } = await got(filterApiUrl);
|
|
|
|
return filterResponse.filter((f) => f.name === name).pop()?.id ?? undefined;
|
|
};
|
|
|
|
module.exports = {
|
|
rootUrl,
|
|
apiSlug,
|
|
GetFilterId,
|
|
};
|