Files
RSSHub/lib/routes/javlibrary/users.js
T
Sukka d82847f541 style/chore(eslint): enforce new rules (#8040)
* style: prefer object shorthand syntax
* refactor: prefer Array#map over Array#forEach
* style: prefer arrow callback
* chore(eslint): update rules
* style: auto fix by eslint
2021-08-17 22:23:23 +08:00

23 lines
660 B
JavaScript

const { template, getVideoComments } = require('./utils');
module.exports = async (ctx) => {
const utype = ctx.params.utype;
const uid = ctx.params.uid;
if (utype === 'userposts') {
const uid = ctx.params.uid;
const link = `http://www.javlibrary.com/cn/userposts.php?u=${uid}`;
const items = await getVideoComments(link);
ctx.state.data = {
title: `Javlibrary - ${uid} 发表的文章`,
link,
item: items,
};
} else {
ctx.state.data = {
link: `http://www.javlibrary.com/cn/${utype}.php?u=${uid}`,
};
await template(ctx);
}
};