Files
RSSHub/lib/routes/furaffinity/browse.js
T
6590c9ef96 feat(radar): add Fur Affinity radar rules (#6930)
* Update social-media.md

* Update social-media.md

* Update social-media.md

* Update radar-rules.js

* [CodeFactor] Apply fixes

[ci skip] [skip ci]

* Update social-media.md

* Update status.js

* Update shouts.js

* Update browse.js

* Update commissions.js

* Update favorites.js

* Update gallery.js

* Update home.js

* Update journals.js

* [CodeFactor] Apply fixes to commit 7ee8b39

[ci skip] [skip ci]

* Update scraps.js

* Update search.js

* Update status.js

* Update user.js

* [CodeFactor] Apply fixes to commit 579e817

[ci skip] [skip ci]

* Update watchers.js

* Update watching.js

* Update watching.js

* Update radar-rules.js

* Update social-media.md

* Update search.js

* Update search.js

* Update social-media.md

* Update social-media.md

* Update social-media.md

* Update social-media.md

* Update social-media.md

Co-authored-by: codefactor-io <support@codefactor.io>
Co-authored-by: NeverBehave <gayhub@never.pet>
2021-02-20 03:34:44 -05:00

45 lines
1.1 KiB
JavaScript

const got = require('@/utils/got');
module.exports = async (ctx) => {
// 传入参数
const nsfw = String(ctx.params.nsfw);
// 判断传入的参数nsfw
let url = 'https://faexport.spangle.org.uk/browse.json?sfw=1';
if (nsfw === '1') {
url = 'https://faexport.spangle.org.uk/browse.json';
}
// 发起 HTTP GET 请求
const response = await got({
method: 'get',
url: url,
headers: {
Referer: `https://faexport.spangle.org.uk/`,
},
});
const data = response.data;
ctx.state.data = {
// 源标题
title: `Fur Affinity Browse`,
// 源链接
link: `https://www.furaffinity.net/browse/`,
// 源说明
description: `Fur Affinity Browse`,
// 遍历此前获取的数据
item: data.map((item) => ({
// 标题
title: item.title,
// 正文
description: `<img src="${item.thumbnail}">`,
// 链接
link: item.link,
// 作者
author: item.name,
// 由于源API未提供日期,故无pubDate
})),
};
};