From 70fa828351280f75090baeace7720b7db7211deb Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 27 Jul 2018 23:31:37 +0800 Subject: [PATCH] rss: one: add type --- routes/one/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/routes/one/index.js b/routes/one/index.js index ee7940642..1de7612e7 100644 --- a/routes/one/index.js +++ b/routes/one/index.js @@ -16,6 +16,7 @@ module.exports = async (ctx) => { const $ = cheerio.load(data); const list = [$('.item.active'), $('.corriente')[0], $('.corriente')[1]]; + const itemMap = ['「图片」', '「文字」', '「问答」']; const out = []; @@ -24,11 +25,13 @@ module.exports = async (ctx) => { .find('a') .attr('href'); const item = { - title: $(list[i]) - .find('a') - .text() - .replace(/\s+/g, ' ') - .trim(), + title: + itemMap[i] + + $(list[i]) + .find('a') + .text() + .replace(/\s+/g, ' ') + .trim(), link: url, description: '', };