diff --git a/.eslintrc b/.eslintrc
index 12251efa9d..8acfcf95b7 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -21,6 +21,15 @@
"no-multi-str": 2,
"comma-spacing": 2,
"comma-style": 2,
+ "no-implicit-coercion": [
+ "error",
+ {
+ "boolean": false,
+ "number": false,
+ "string": false,
+ "disallowTemplateShorthand": true
+ }
+ ],
"func-call-spacing": 2,
"keyword-spacing": 2,
"linebreak-style": 2,
diff --git a/assets/radar-rules.js b/assets/radar-rules.js
index aaadae7bfc..820356b393 100644
--- a/assets/radar-rules.js
+++ b/assets/radar-rules.js
@@ -2183,7 +2183,7 @@
docs: 'https://docs.rsshub.app/multimedia.html#onejav',
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
target: (params, url, document) => {
- const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day';
+ const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day';
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
if (ikey === '' && itype === 'tag') {
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F');
@@ -2221,7 +2221,7 @@
docs: 'https://docs.rsshub.app/multimedia.html#141jav',
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
target: (params, url, document) => {
- const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day';
+ const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day';
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
if (ikey === '' && itype === 'tag') {
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F');
@@ -2259,7 +2259,7 @@
docs: 'https://docs.rsshub.app/multimedia.html#141ppv',
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
target: (params, url, document) => {
- const itype = params.morekey === undefined ? `${params.type}` : params.type === 'tag' ? 'tag' : 'day';
+ const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day';
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
if (ikey === '' && itype === 'tag') {
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F');
diff --git a/docs/en/joinus/quick-start.md b/docs/en/joinus/quick-start.md
index 042a21a4d4..baaf61cdc0 100644
--- a/docs/en/joinus/quick-start.md
+++ b/docs/en/joinus/quick-start.md
@@ -141,7 +141,7 @@ Create a new js script in [/lib/routes/](https://github.com/DIYgod/RSSHub/tree/m
list
.map((index, item) => {
item = $(item);
- itemPicUrl = `${item.find('a.cover').attr('style')}`.replace('background-image:url(', '').replace(')', '');
+ itemPicUrl = item.find('a.cover').attr('style').replace('background-image:url(', '').replace(')', '');
return {
title: item.find('.title a').first().text(),
description: `作者:${item.find('.usr-pic a').last().text()}
描述:${item.find('.content p').text()}`,
diff --git a/docs/joinus/quick-start.md b/docs/joinus/quick-start.md
index e493c1f77d..31508baf92 100644
--- a/docs/joinus/quick-start.md
+++ b/docs/joinus/quick-start.md
@@ -142,7 +142,7 @@ sidebar: auto
list
.map((index, item) => {
item = $(item);
- itemPicUrl = `${item.find('a.cover').attr('style')}`.replace('background-image:url(', '').replace(')', '');
+ itemPicUrl = item.find('a.cover').attr('style').replace('background-image:url(', '').replace(')', '');
return {
title: item.find('.title a').first().text(),
description: `作者:${item.find('.usr-pic a').last().text()}
描述:${item.find('.content p').text()}`,
diff --git a/lib/middleware/header.js b/lib/middleware/header.js
index 92817583d5..2292ddbed4 100644
--- a/lib/middleware/header.js
+++ b/lib/middleware/header.js
@@ -15,7 +15,7 @@ module.exports = async (ctx, next) => {
logger.info(`${ctx.url}, user IP: ${ctx.ips[0] || ctx.ip}`);
ctx.set(headers);
ctx.set({
- 'Access-Control-Allow-Origin': `${config.allowOrigin || ctx.host}`,
+ 'Access-Control-Allow-Origin': config.allowOrigin || ctx.host,
});
await next();
diff --git a/lib/routes/1point3acres/post.js b/lib/routes/1point3acres/post.js
index 7b3ed5b8a8..3f85db70e6 100644
--- a/lib/routes/1point3acres/post.js
+++ b/lib/routes/1point3acres/post.js
@@ -22,7 +22,7 @@ module.exports = async (ctx) => {
const items = await Promise.all(
data.map(async (item) => {
const result = {
- title: `${item.subject}`,
+ title: item.subject,
description: `${item.summary}...
作者 ${item.author} · 回复 ${item.replies} · 查看 ${item.views}`,
link: `https://instant.1point3acres.com/thread/${item.tid}`,
};
diff --git a/lib/routes/36kr/motif.js b/lib/routes/36kr/motif.js
index a60a0062f1..eaeea1c4c0 100644
--- a/lib/routes/36kr/motif.js
+++ b/lib/routes/36kr/motif.js
@@ -30,6 +30,6 @@ module.exports = async (ctx) => {
})
)
),
- description: `${motifInfo.categoryTitle}`,
+ description: motifInfo.categoryTitle,
};
};
diff --git a/lib/routes/aliyun/developer/group.js b/lib/routes/aliyun/developer/group.js
index 235824be2b..940cb23e39 100644
--- a/lib/routes/aliyun/developer/group.js
+++ b/lib/routes/aliyun/developer/group.js
@@ -28,7 +28,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `阿里云开发者社区-${title}`,
link,
- description: `${desc}`,
+ description: desc,
item:
list &&
list
diff --git a/lib/routes/asahi/index.js b/lib/routes/asahi/index.js
index 7b65c638eb..da21e0d816 100644
--- a/lib/routes/asahi/index.js
+++ b/lib/routes/asahi/index.js
@@ -29,7 +29,20 @@ module.exports = async (ctx) => {
const category = ctx.params.category || '';
const rootUrl = 'https://www.asahi.com';
- const currentUrl = `${rootUrl}${genre ? `${category ? `${category in categories ? categories[category] : `/${genre}/list/${category}.html`}` : `/${genre}`}` : '/news/history.html'}`;
+ let currentUrl;
+ if (genre) {
+ if (category) {
+ if (category in categories) {
+ currentUrl = `${rootUrl}${categories[category]}`;
+ } else {
+ currentUrl = `${rootUrl}/${genre}/list/${category}.html`;
+ }
+ } else {
+ currentUrl = `${rootUrl}/${genre}`;
+ }
+ } else {
+ currentUrl = `${rootUrl}${'/news/history.html'}`;
+ }
const response = await got({
method: 'get',
diff --git a/lib/routes/av01/actor.js b/lib/routes/av01/actor.js
index de5d90270e..d5530a0f06 100644
--- a/lib/routes/av01/actor.js
+++ b/lib/routes/av01/actor.js
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
- const itemPicUrl = `${item.find('img').attr('data-src')}`;
+ const itemPicUrl = item.find('img').attr('data-src');
return {
title: item.find('span.video-title.title-truncate.m-t-5').text(),
description: `翻译${item.find('div.video-added.title-truncate').text()}`,
diff --git a/lib/routes/av01/tag.js b/lib/routes/av01/tag.js
index 981300be8d..bbea8663d4 100644
--- a/lib/routes/av01/tag.js
+++ b/lib/routes/av01/tag.js
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
- const itemPicUrl = `${item.find('img').attr('data-src')}`;
+ const itemPicUrl = item.find('img').attr('data-src');
return {
title: item.find('span.video-title.title-truncate.m-t-5').text(),
description: `翻译${item.find('div.video-added.title-truncate').text()}
`,
diff --git a/lib/routes/avgle/videos.js b/lib/routes/avgle/videos.js
index 3ca77d83b5..3d08e3cc18 100644
--- a/lib/routes/avgle/videos.js
+++ b/lib/routes/avgle/videos.js
@@ -28,7 +28,7 @@ module.exports = async (ctx) => {
});
const returnData = response.data.response.videos;
- const compact_number = (number) => `${Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' }).format(number)}`;
+ const compact_number = (number) => String(Intl.NumberFormat('en-US', { notation: 'compact', compactDisplay: 'short' }).format(number));
const like = (item) => `[${Math.round((item.likes / (item.likes + item.dislikes)) * 100)}%/${compact_number(item.likes + item.dislikes)}/${compact_number(item.viewnumber)}]`;
ctx.state.data = {
@@ -37,7 +37,7 @@ module.exports = async (ctx) => {
description: `Avgle ${order}/${time}`,
item: returnData.map((item) => ({
title: like(item) + item.title,
- description: `${item.preview_video_url ? `` : ''}`,
+ description: item.preview_video_url ? `` : '',
pubDate: new Date(item.addtime * 1000).toUTCString(),
link: item.video_url,
category: item.keyword.split(' '),
diff --git a/lib/routes/axis-studios/work.js b/lib/routes/axis-studios/work.js
index f6b6e300a9..76b6e034e9 100755
--- a/lib/routes/axis-studios/work.js
+++ b/lib/routes/axis-studios/work.js
@@ -73,9 +73,9 @@ module.exports = async (ctx) => {
video = `
`;
}
return {
- title: `${articledata[index].title}`,
+ title: articledata[index].title,
description: `${video}+${articledata[index].describe}`,
- link: `${articledata[index].link}`,
+ link: articledata[index].link,
};
}),
};
diff --git a/lib/routes/bangumi/calendar/today.js b/lib/routes/bangumi/calendar/today.js
index bc602f6dd0..5234a19e0e 100644
--- a/lib/routes/bangumi/calendar/today.js
+++ b/lib/routes/bangumi/calendar/today.js
@@ -13,7 +13,7 @@ module.exports = async (ctx) => {
const todayList = list.filter((l) => l.weekday.id % 7 === day)[0];
- const todayBgmId = todayList.items.map((t) => `${t.id}`);
+ const todayBgmId = todayList.items.map((t) => t.id);
const images = todayList.items.reduce((p, c) => {
p[c.id] = (c.images || {}).large;
return p;
diff --git a/lib/routes/bangumi/group/topic.js b/lib/routes/bangumi/group/topic.js
index 95dcb2d9a6..5022688015 100644
--- a/lib/routes/bangumi/group/topic.js
+++ b/lib/routes/bangumi/group/topic.js
@@ -12,7 +12,7 @@ module.exports = async (ctx) => {
const title = 'Bangumi - ' + $('.SecondaryNavTitle').text();
ctx.state.data = {
- title: `${title}`,
+ title,
link,
item: $('.topic_list .topic')
.map((_, elem) => ({
diff --git a/lib/routes/bangumi/subject/ep.js b/lib/routes/bangumi/subject/ep.js
index ed11f010cf..41e8142229 100644
--- a/lib/routes/bangumi/subject/ep.js
+++ b/lib/routes/bangumi/subject/ep.js
@@ -12,7 +12,7 @@ module.exports = async (subjectID) => {
});
return {
- title: `${epsInfo.name_cn}`,
+ title: epsInfo.name_cn,
link: `https://bgm.tv/subject/${subjectID}`,
description: epsInfo.summary,
item: activeEps.reverse().map((e) => ({
diff --git a/lib/routes/behance/index.js b/lib/routes/behance/index.js
index 0f3806e1e3..2b28b268d7 100644
--- a/lib/routes/behance/index.js
+++ b/lib/routes/behance/index.js
@@ -42,15 +42,15 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
title: `${data.profile.owner.first_name} ${data.profile.owner.last_name}'s Work`,
- link: `${data.profile.owner.url}`,
+ link: data.profile.owner.url,
item: list.map((item, index) => {
if (type !== 'projects') {
item = item.project;
}
return {
- title: `${item.name}`,
- description: `${articledata[index].content}`,
- link: `${item.url}`,
+ title: item.name,
+ description: articledata[index].content,
+ link: item.url,
pubDate: dayjs.unix(item.published_on).format(),
};
}),
diff --git a/lib/routes/bilibili/blackboard.js b/lib/routes/bilibili/blackboard.js
index 2017a411f7..ff19955e46 100644
--- a/lib/routes/bilibili/blackboard.js
+++ b/lib/routes/bilibili/blackboard.js
@@ -22,10 +22,10 @@ module.exports = async (ctx) => {
!index || item.name !== array[index - 1].name
)
.map((item) => ({
- title: `${item.name}`,
+ title: item.name,
description: `${item.name}
${item.desc}`,
pubDate: new Date(item.ctime.replace(' ', 'T') + '+08:00').toUTCString(),
- link: `${item.pc_url}`,
+ link: item.pc_url,
})),
};
};
diff --git a/lib/routes/bilibili/dynamic.js b/lib/routes/bilibili/dynamic.js
index a47e07aebf..ee11281b5b 100644
--- a/lib/routes/bilibili/dynamic.js
+++ b/lib/routes/bilibili/dynamic.js
@@ -190,10 +190,14 @@ module.exports = async (ctx) => {
return {
title: getTitle(data),
- description: `${data_content || getDes(data)}${
- origin && getOriginName(origin) ? `
//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : `${getOriginDes(origin)}`
- }
${getUrl(data)}${getUrl(origin)}${getIframe(data)}${getIframe(origin)}${imgHTML ? `
${imgHTML}` : ''}${videoHTML ? `
${videoHTML}` : ''}`,
- pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
+ description: (() => {
+ const description = data_content || getDes(data);
+ const originName = origin && getOriginName(origin) ? `
//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : getOriginDes(origin);
+ const imgHTMLSource = imgHTML ? `
${imgHTML}` : '';
+ const videoHTMLSource = videoHTML ? `
${videoHTML}` : '';
+ return `${description}${originName}
${getUrl(data)}${getUrl(origin)}${getIframe(data)}${getIframe(origin)}${imgHTMLSource}${videoHTMLSource}`;
+ })(),
+ pubDate: new Date(item.desc.timestamp * 1000),
link,
};
}),
diff --git a/lib/routes/bilibili/followings_dynamic.js b/lib/routes/bilibili/followings_dynamic.js
index b3739e66c4..59f1b89492 100644
--- a/lib/routes/bilibili/followings_dynamic.js
+++ b/lib/routes/bilibili/followings_dynamic.js
@@ -121,9 +121,14 @@ module.exports = async (ctx) => {
return {
title: getTitle(data),
author,
- description: `${parsed.new_desc || data_content || getDes(data)}${
- origin && getOriginName(origin) ? `
//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : `${getOriginDes(origin)}`
- }${getIframe(data)}${getIframe(origin)}${imgHTML ? `
${imgHTML}` : ''}${videoHTML ? `
${videoHTML}` : ''}`,
+ description: (() => {
+ const description = parsed.new_desc || data_content || getDes(data);
+ const originName = origin && getOriginName(origin) ? `
//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : getOriginDes(origin);
+ const imgHTMLSource = imgHTML ? `
${imgHTML}` : '';
+ const videoHTMLSource = videoHTML ? `
${videoHTML}` : '';
+
+ return `${description}${originName}${getIframe(data)}${getIframe(origin)}${imgHTMLSource}${videoHTMLSource}`;
+ })(),
pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
link,
};
diff --git a/lib/routes/bilibili/liveArea.js b/lib/routes/bilibili/liveArea.js
index a7d833d31f..eaf5c92e3c 100644
--- a/lib/routes/bilibili/liveArea.js
+++ b/lib/routes/bilibili/liveArea.js
@@ -61,7 +61,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `哔哩哔哩直播-${parentTitle}·${areaTitle}分区-${orderTitle}`,
- link: `${areaLink}`,
+ link: areaLink,
description: `哔哩哔哩直播-${parentTitle}·${areaTitle}分区-${orderTitle}`,
item: data.map((item) => ({
title: `${item.uname} ${item.title}`,
diff --git a/lib/routes/bilibili/partion-ranking.js b/lib/routes/bilibili/partion-ranking.js
index 0c22f94453..cb0c792943 100644
--- a/lib/routes/bilibili/partion-ranking.js
+++ b/lib/routes/bilibili/partion-ranking.js
@@ -41,7 +41,7 @@ module.exports = async (ctx) => {
let item = hotlist[i];
item = {
- title: `${item.title}`,
+ title: item.title,
description: `${item.description}${!disableEmbed ? `
${utils.iframe(item.id)}` : ''}
Tags:${item.tag}`,
pubDate: new Date(item.pubdate).toUTCString(),
link: item.pubdate > utils.bvidTime && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.id}`,
diff --git a/lib/routes/bilibili/partion.js b/lib/routes/bilibili/partion.js
index cbe50aceed..50e1e441fc 100644
--- a/lib/routes/bilibili/partion.js
+++ b/lib/routes/bilibili/partion.js
@@ -26,7 +26,7 @@ module.exports = async (ctx) => {
item:
list &&
list.map((item) => ({
- title: `${item.title}`,
+ title: item.title,
description: `${item.desc}${!disableEmbed ? `
${utils.iframe(item.aid)}` : ''}`,
pubDate: new Date(item.pubdate * 1000).toUTCString(),
link: item.pubdate > utils.bvidTime && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.aid}`,
diff --git a/lib/routes/bilibili/weekly_recommend.js b/lib/routes/bilibili/weekly_recommend.js
index e2867b97c2..127db303f2 100644
--- a/lib/routes/bilibili/weekly_recommend.js
+++ b/lib/routes/bilibili/weekly_recommend.js
@@ -29,7 +29,12 @@ module.exports = async (ctx) => {
description: 'B站每周必看',
item: data.map((item) => ({
title: item.title,
- description: `${weekly_name} ${item.title}
${item.rcmd_reason}
${!disableEmbed ? `${utils.iframe(item.param)}` : ''}`,
+ // description: `${weekly_name} ${item.title}
${item.rcmd_reason}
${!disableEmbed ? `${utils.iframe(item.param)}` : ''}`,
+ description: `
+ ${weekly_name} ${item.title}
+ ${item.rcmd_reason}
+ ${!disableEmbed ? utils.iframe(item.param) : ''}
+ `,
link: weekly_number > 60 && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.param}`,
})),
};
diff --git a/lib/routes/bjnews/epaper.js b/lib/routes/bjnews/epaper.js
index 6bc8744331..17db2afaa3 100644
--- a/lib/routes/bjnews/epaper.js
+++ b/lib/routes/bjnews/epaper.js
@@ -72,9 +72,9 @@ module.exports = async (ctx) => {
title: `新京报电子报|${cat}叠`,
link: `http://epaper.bjnews.com.cn/html/${year}-${month}/${day}/node_1.htm`,
item: list.map((item, index) => ({
- title: `${articledata[index].title}`,
- description: `${articledata[index].description}`,
- link: `${articledata[index].link}`,
+ title: articledata[index].title,
+ description: articledata[index].description,
+ link: articledata[index].link,
})),
};
};
diff --git a/lib/routes/blow-studio/work.js b/lib/routes/blow-studio/work.js
index ad5f9363cd..b323963164 100755
--- a/lib/routes/blow-studio/work.js
+++ b/lib/routes/blow-studio/work.js
@@ -53,7 +53,7 @@ module.exports = async (ctx) => {
const imgstyle = `style="max-width: 650px; height: auto; object-fit: contain; flex: 0 0 auto;"`;
content += `
`;
- content += `${articledata[index].describe}`;
+ content += articledata[index].describe;
if (articledata[index].images) {
for (let p = 0; p < articledata[index].images.length; p++) {
@@ -62,9 +62,9 @@ module.exports = async (ctx) => {
}
return {
- title: `${articledata[index].title}`,
- description: `${content}`,
- link: `${articledata[index].link}`,
+ title: articledata[index].title,
+ description: content,
+ link: articledata[index].link,
};
}),
};
diff --git a/lib/routes/blur-studio/index.js b/lib/routes/blur-studio/index.js
index dca797516d..da070395ff 100755
--- a/lib/routes/blur-studio/index.js
+++ b/lib/routes/blur-studio/index.js
@@ -72,9 +72,9 @@ module.exports = async (ctx) => {
}
return {
- title: `${articledata[index].title}`,
- description: `${content}`,
- link: `${articledata[index].link}`,
+ title: articledata[index].title,
+ description: content,
+ link: articledata[index].link,
};
}),
};
diff --git a/lib/routes/chinafile/index.js b/lib/routes/chinafile/index.js
index 639ba128b3..5cc5bf1790 100644
--- a/lib/routes/chinafile/index.js
+++ b/lib/routes/chinafile/index.js
@@ -40,7 +40,7 @@ module.exports = async (ctx) => {
url = $('link[rel="canonical"]').attr('href');
- const pubDate = dayjs(`${item.pubDate.replace(' - ', ' ').replace('am', ' am').replace('pm', ' pm')}`).toISOString();
+ const pubDate = dayjs(item.pubDate.replace(' - ', ' ').replace('am', ' am').replace('pm', ' pm'));
return {
title: item.title,
diff --git a/lib/routes/coolapk/dyh.js b/lib/routes/coolapk/dyh.js
index 5f9a9bfa02..1c4bd41d07 100644
--- a/lib/routes/coolapk/dyh.js
+++ b/lib/routes/coolapk/dyh.js
@@ -35,7 +35,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `酷安看看号-${targetTitle}`,
link: `https://www.coolapk.com/dyh/${dyhId}`,
- description: `${feedDescription}`,
+ description: feedDescription,
item: out,
};
};
diff --git a/lib/routes/coolapk/tuwen.js b/lib/routes/coolapk/tuwen.js
index e40d57701e..0c546125b9 100644
--- a/lib/routes/coolapk/tuwen.js
+++ b/lib/routes/coolapk/tuwen.js
@@ -25,9 +25,9 @@ module.exports = async (ctx) => {
const out = await Promise.all(data.map((item) => utils.parseDynamic(item, ctx)));
ctx.state.data = {
- title: `${feedTitle}`,
+ title: feedTitle,
link: 'https://www.coolapk.com/',
- description: `${feedTitle}`,
+ description: feedTitle,
item: out,
};
};
diff --git a/lib/routes/coronavirus/sg-moh.js b/lib/routes/coronavirus/sg-moh.js
index d05db0c093..94fbeb54c6 100644
--- a/lib/routes/coronavirus/sg-moh.js
+++ b/lib/routes/coronavirus/sg-moh.js
@@ -19,7 +19,7 @@ module.exports = async (ctx) => {
})
.map((_, item) => {
item = $(item);
- const title = `${item.find('a').first().text()}`;
+ const title = item.find('a').first().text();
const dateRaw = item.find('td:first-child').text().trim();
const pubDate = Date.parse(dateRaw) && dateRaw;
const link = item.find('a').attr('href');
diff --git a/lib/routes/digic-pictures/index.js b/lib/routes/digic-pictures/index.js
index 7954574a25..6c5fcfe313 100755
--- a/lib/routes/digic-pictures/index.js
+++ b/lib/routes/digic-pictures/index.js
@@ -62,10 +62,10 @@ module.exports = async (ctx) => {
}
}
return {
- title: `${articledata[index].title}`,
+ title: articledata[index].title,
description: content,
- link: `${articledata[index].link}`,
- pubDate: `${articledata[index].time}`,
+ link: articledata[index].link,
+ pubDate: new Date(articledata[index].time),
};
}),
};
diff --git a/lib/routes/digitaling/article.js b/lib/routes/digitaling/article.js
index 2bf5743471..09dde18b95 100644
--- a/lib/routes/digitaling/article.js
+++ b/lib/routes/digitaling/article.js
@@ -30,7 +30,7 @@ module.exports = async (ctx) => {
let link = `https://www.digitaling.com/articles/${category}/`;
// 二级子分类
if (subcate !== undefined) {
- link = link + `${subcate}`;
+ link = link + subcate;
title = title + '/' + categoryTitle.get(category).type[subcate];
}
const res = await got.get(link);
diff --git a/lib/routes/douban/channel/subject.js b/lib/routes/douban/channel/subject.js
index ab66542e40..0bf7de3b6f 100644
--- a/lib/routes/douban/channel/subject.js
+++ b/lib/routes/douban/channel/subject.js
@@ -22,7 +22,7 @@ module.exports = async (ctx) => {
});
const channel_name = channel_info_response.data.title;
- const data = response.data.modules[`${nav}`].payload.subjects;
+ const data = response.data.modules[nav].payload.subjects;
let nav_name = '';
switch (nav) {
@@ -46,7 +46,7 @@ module.exports = async (ctx) => {
description: `豆瓣${channel_name}频道书影音下的${nav_name}推荐`,
item: data.map(({ title, extra, cover_img, url }) => {
- const rate = `${extra.rating_group.rating}` ? `${extra.rating_group.rating.value.toFixed(1)}分` : `${extra.rating_group.null_rating_reason}`;
+ const rate = extra.rating_group.rating ? `${extra.rating_group.rating.value.toFixed(1)}分` : extra.rating_group.null_rating_reason;
const description = `标题:${title}
信息:${extra.short_info}
评分:${rate}
`;
diff --git a/lib/routes/douban/channel/topic.js b/lib/routes/douban/channel/topic.js
index 6e8be04891..743e2c7628 100644
--- a/lib/routes/douban/channel/topic.js
+++ b/lib/routes/douban/channel/topic.js
@@ -48,10 +48,10 @@ module.exports = async (ctx) => {
const description = `作者:${item.author.name} | ${item.create_time}
${item.abstract}">`;
return {
- title: `${item.title}`,
+ title: item.title,
description,
- pubDate: `${item.create_time}`,
- link: `${item.url}`,
+ pubDate: new Date(item.create_time),
+ link: item.url,
};
} else {
return null;
diff --git a/lib/routes/douban/explore.js b/lib/routes/douban/explore.js
index 7fcf052aaa..fa56b2fafc 100644
--- a/lib/routes/douban/explore.js
+++ b/lib/routes/douban/explore.js
@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
- itemPicUrl = `${item.find('a.cover').attr('style')}`.replace('background-image:url(', '').replace(')', '');
+ itemPicUrl = item.find('a.cover').attr('style').replace('background-image:url(', '').replace(')', '');
return {
title: item.find('.title a').first().text(),
description: `作者:${item.find('.usr-pic a').last().text()}
描述:${item.find('.content p').text()}`,
diff --git a/lib/routes/douban/people/status.js b/lib/routes/douban/people/status.js
index 7caceef00d..bada4b9cf4 100644
--- a/lib/routes/douban/people/status.js
+++ b/lib/routes/douban/people/status.js
@@ -260,7 +260,16 @@ function getContentByActivity(ctx, item, params = {}, picsPrefixes = []) {
}
const videoCover = status.video_info.cover_url;
const videoSrc = status.video_info.video_url;
- description += `${videoSrc ? `` : ''}`;
+ if (videoSrc) {
+ description = `
+ ${description}
+
+ `;
+ }
}
if (status.parent_status) {
diff --git a/lib/routes/douban/people/wish.js b/lib/routes/douban/people/wish.js
index ba826de74c..032a7827a9 100644
--- a/lib/routes/douban/people/wish.js
+++ b/lib/routes/douban/people/wish.js
@@ -35,7 +35,7 @@ module.exports = async (ctx) => {
return Promise.all(
list.get().map(async (item) => {
item = $(item);
- const itemPicUrl = `${item.find('.pic a img').attr('src')}`;
+ const itemPicUrl = item.find('.pic a img').attr('src');
const info = item.find('.info');
const title = info.find('ul li.title a').text();
const url = info.find('ul li.title a').attr('href');
diff --git a/lib/routes/dxy/vaccine.js b/lib/routes/dxy/vaccine.js
index 8e6b181524..74c90cbbcb 100644
--- a/lib/routes/dxy/vaccine.js
+++ b/lib/routes/dxy/vaccine.js
@@ -4,7 +4,16 @@ module.exports = async (ctx) => {
const province = ctx.params.province || '';
const city = ctx.params.city || '';
const location = ctx.params.location || '';
- const fullLocation = `${province ? `${province}${city ? `/${city}${location ? `/${location}` : ''}` : ''}` : ''}`;
+ let fullLocation = '';
+ if (province) {
+ fullLocation += `/${province}`;
+ if (city) {
+ fullLocation += `/${city}`;
+ if (location) {
+ fullLocation += `/${location}`;
+ }
+ }
+ }
const rootUrl = 'https://mama.dxy.com';
const currentUrl = `${rootUrl}/client/vaccine/new-crown-vaccine`;
diff --git a/lib/routes/fanbox/conv.js b/lib/routes/fanbox/conv.js
index d85c936385..e5f0b628fa 100644
--- a/lib/routes/fanbox/conv.js
+++ b/lib/routes/fanbox/conv.js
@@ -188,7 +188,7 @@ async function conv_article(i) {
}
if (!i.body) {
- ret += `${i.excerpt}`;
+ ret += i.excerpt;
return ret;
}
diff --git a/lib/routes/galgame/hhgal.js b/lib/routes/galgame/hhgal.js
index eae2ed3f99..50664d8919 100644
--- a/lib/routes/galgame/hhgal.js
+++ b/lib/routes/galgame/hhgal.js
@@ -54,13 +54,13 @@ module.exports = async (ctx) => {
.slice(1)
.map((index, item) => {
item = $(item);
- const time = `${item.find('.tag-article .label.label-zan').text()}`;
+ const time = item.find('.tag-article .label.label-zan').text();
const math = /\d{4}-\d{2}-\d{2}/.exec(time);
const pubDate = new Date(math[0]);
return {
title: item.find('h1').text(),
- description: `${item.find('.info p').text()}`,
+ description: item.find('.info p').text(),
pubDate,
link: item.find('h1 a').attr('href'),
};
diff --git a/lib/routes/github/starred_repos.js b/lib/routes/github/starred_repos.js
index ffd1a6a32f..25b218a8f4 100644
--- a/lib/routes/github/starred_repos.js
+++ b/lib/routes/github/starred_repos.js
@@ -56,8 +56,8 @@ module.exports = async (ctx) => {
description: `${repo.node.description === null ? 'no description' : repo.node.description}
primary language: ${
repo.node.primaryLanguage === null ? 'no primary language' : repo.node.primaryLanguage.name
}
stargazers: ${repo.node.stargazers.totalCount}
`,
- pubDate: new Date(`${repo.starredAt}`).toUTCString(),
- link: `${repo.node.url}`,
+ pubDate: new Date(repo.starredAt),
+ link: repo.node.url,
})),
};
};
diff --git a/lib/routes/github/topic.js b/lib/routes/github/topic.js
index 55287fddac..b1127d2763 100644
--- a/lib/routes/github/topic.js
+++ b/lib/routes/github/topic.js
@@ -15,7 +15,7 @@ module.exports = async (ctx) => {
const title = $(item.find('h1 a').get(1)).attr('href').slice(1);
const author = title.split('/')[0];
- const description = `${item.find('div.border-bottom > div > p + div').text()}`;
+ const description = item.find('div.border-bottom > div > p + div').text();
const link = `https://github.com/${title}`;
return { title, author, description, link };
diff --git a/lib/routes/gov/moa/sjzxfb.js b/lib/routes/gov/moa/sjzxfb.js
index 39f4e71b98..c9058775dc 100644
--- a/lib/routes/gov/moa/sjzxfb.js
+++ b/lib/routes/gov/moa/sjzxfb.js
@@ -11,10 +11,10 @@ module.exports = async (ctx) => {
title: '中华人民共和国农业农村部 - 数据 - 最新发布',
link: `http://zdscxx.moa.gov.cn:8080/nyb/pc/index.jsp`,
item: data.map((item) => ({
- title: `${item.title}`,
- description: `${item.content}`,
+ title: item.title,
+ description: item.content,
link: `http://zdscxx.moa.gov.cn:8080/misportal/public/agricultureMessageViewDC.jsp?page=1&channel=%E6%9C%80%E6%96%B0%E5%8F%91%E5%B8%83&id=${item._id}`,
- pubDate: `${item.publishTime}`,
+ pubDate: new Date(item.publishTime),
})),
};
};
diff --git a/lib/routes/gov/province/jiangsu/getContent.js b/lib/routes/gov/province/jiangsu/getContent.js
index f2434069ff..fa0220be74 100644
--- a/lib/routes/gov/province/jiangsu/getContent.js
+++ b/lib/routes/gov/province/jiangsu/getContent.js
@@ -58,8 +58,7 @@ async function extract(homePage, cid, uid, page = 1) {
const description = $aTag.attr('title');
let pubDate = $item.find('span').text();
pubDate = new Date(pubDate).toUTCString();
- let link = $aTag.attr('href');
- link = `${link}`;
+ const link = $aTag.attr('href');
return { title, description, pubDate, link };
});
diff --git a/lib/routes/gov/taiwan/mnd.js b/lib/routes/gov/taiwan/mnd.js
index 69f44aec24..ca275ac121 100644
--- a/lib/routes/gov/taiwan/mnd.js
+++ b/lib/routes/gov/taiwan/mnd.js
@@ -48,7 +48,7 @@ module.exports = async (ctx) => {
const content = cheerio.load(detailResponse.data);
item.description = content('div.thisPages').html();
- item.link = content('form[name="aspnetForm"]').attr('action').replace('.', `${rootUrl}`);
+ item.link = content('form[name="aspnetForm"]').attr('action').replace('.', rootUrl);
return item;
})
diff --git a/lib/routes/gracg/user.js b/lib/routes/gracg/user.js
index b2e9548767..86c149be66 100644
--- a/lib/routes/gracg/user.js
+++ b/lib/routes/gracg/user.js
@@ -5,7 +5,7 @@ module.exports = async (ctx) => {
const url = ctx.params.love ? `https://www.gracg.com/${ctx.params.user}/love` : `https://www.gracg.com/${ctx.params.user}`;
const response = await got({
method: 'get',
- url: `${url}`,
+ url,
});
const html = response.body;
const $ = cheerio.load(html);
diff --git a/lib/routes/guancha/index.js b/lib/routes/guancha/index.js
index 77a1b43d25..f9f755a83a 100644
--- a/lib/routes/guancha/index.js
+++ b/lib/routes/guancha/index.js
@@ -44,7 +44,7 @@ module.exports = async (ctx) => {
const link = item.attr('href');
return {
title: item.text(),
- link: `${(link.indexOf('http') === 0 ? '' : rootUrl) + link}`,
+ link: (link.indexOf('http') === 0 ? '' : rootUrl) + link,
};
})
.get();
diff --git a/lib/routes/guancha/personalpage.js b/lib/routes/guancha/personalpage.js
index 154f37f1df..f935e195c6 100644
--- a/lib/routes/guancha/personalpage.js
+++ b/lib/routes/guancha/personalpage.js
@@ -63,7 +63,7 @@ module.exports = async (ctx) => {
description: `${user_nick} 的个人主页`,
item: list.map((item) => ({
title: item.title,
- description: `${item.summary}`,
+ description: item.summary,
pubDate: getpass_at(item.pass_at),
link: `https://user.guancha.cn/main/content?id=${item.id}`,
author: item.user_nick,
diff --git a/lib/routes/hinatazaka46/blog.js b/lib/routes/hinatazaka46/blog.js
index eaed2d9f7f..5dae478750 100644
--- a/lib/routes/hinatazaka46/blog.js
+++ b/lib/routes/hinatazaka46/blog.js
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
- itemPicUrl = `${item.find('div.c-blog__image').attr('style')}`.replace('background-image:url(', '').replace(');', '');
+ itemPicUrl = item.find('div.c-blog__image').attr('style').replace('background-image:url(', '').replace(');', '');
return {
title: item.find('p.c-blog-top__title').text().trim(),
link: item.find('a').first().attr('href'),
diff --git a/lib/routes/hkepc/index.js b/lib/routes/hkepc/index.js
index e38abac1c6..4b0e088072 100644
--- a/lib/routes/hkepc/index.js
+++ b/lib/routes/hkepc/index.js
@@ -92,7 +92,7 @@ module.exports = async (ctx) => {
method: 'get',
url: link,
headers: {
- Referer: `${baseUrl}`,
+ Referer: baseUrl,
},
});
return cheerio.load(resp.data)('#article').html();
diff --git a/lib/routes/hket/index.js b/lib/routes/hket/index.js
index 673b6eb7ed..c5df0ab8e5 100644
--- a/lib/routes/hket/index.js
+++ b/lib/routes/hket/index.js
@@ -45,10 +45,10 @@ module.exports = async (ctx) => {
const category = ctx.params.category || 'sran001';
const cat = categories[category];
- const response = await ctx.cache.tryGet(`${cat.link}`, async () => {
+ const response = await ctx.cache.tryGet(cat.link, async () => {
const resp = await got({
method: 'get',
- url: `${cat.link}`,
+ url: cat.link,
header: {
Referer: `https://www.hket.com/`,
},
@@ -79,7 +79,7 @@ module.exports = async (ctx) => {
method: 'get',
url: item.link,
header: {
- Referer: `${cat.link}`,
+ Referer: cat.link,
},
});
const content = cheerio.load(article.data);
@@ -121,7 +121,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${cat.title}新聞RSS - 香港經濟日報 hket.com`,
- link: `${cat.link}`,
+ link: cat.link,
description: `訂閱${cat.title}新聞RSS,獲取最新${cat.description} - RSS - 香港經濟日報 hket.com`,
item: items,
language: 'zh-hk',
diff --git a/lib/routes/huxiu/collection.js b/lib/routes/huxiu/collection.js
index 1390db50d0..093be874c7 100644
--- a/lib/routes/huxiu/collection.js
+++ b/lib/routes/huxiu/collection.js
@@ -25,7 +25,7 @@ module.exports = async (ctx) => {
const items = await utils.ProcessFeed(list, ctx.cache);
const info = `虎嗅 - ${$('h1').text()}`;
- const description = `${$('p').text()}`;
+ const description = $('p').text();
ctx.state.data = {
title: info,
link,
diff --git a/lib/routes/ieee/author.js b/lib/routes/ieee/author.js
index fb03455797..cb26530050 100644
--- a/lib/routes/ieee/author.js
+++ b/lib/routes/ieee/author.js
@@ -17,7 +17,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${author.preferredName} on IEEE Xplore`,
link: `https://ieeexplore.ieee.org/author/${aid}`,
- description: `${author.bioParagraphs.join('
')}`,
+ description: author.bioParagraphs.join('
'),
item: papers.records.map((item) => ({
title: item.articleTitle,
author: item.authors.map((author) => author.preferredName).join(', '),
diff --git a/lib/routes/imaijia/category.js b/lib/routes/imaijia/category.js
index 05a449f706..79ba232c55 100644
--- a/lib/routes/imaijia/category.js
+++ b/lib/routes/imaijia/category.js
@@ -14,7 +14,7 @@ module.exports = async (ctx) => {
url: api_url,
form: {
pageNo: 1,
- catid: `${category}`,
+ catid: category,
},
});
diff --git a/lib/routes/jandan/pic.js b/lib/routes/jandan/pic.js
index 77ddb8c339..73df758a4f 100644
--- a/lib/routes/jandan/pic.js
+++ b/lib/routes/jandan/pic.js
@@ -97,9 +97,9 @@ module.exports = async (ctx) => {
}
ctx.state.data = {
- title: `${rss_title}`,
+ title: rss_title,
link: `${baseUrl}${sub_model}/`,
- description: `${description}`,
+ description,
item: items,
};
};
diff --git a/lib/routes/japanpost/track.js b/lib/routes/japanpost/track.js
index f2f1097e9c..9824cd391a 100644
--- a/lib/routes/japanpost/track.js
+++ b/lib/routes/japanpost/track.js
@@ -63,7 +63,7 @@ module.exports = async (ctx) => {
itemDescription += packageTrackRecord ? `${packageTrackRecord}
` : '';
itemDescription += packageOfficeZipCode ? `${packageOfficeZipCode} ` : '';
itemDescription += packageOffice ? `${packageOffice} ` : '';
- itemDescription += `${packageRegion}`;
+ itemDescription += packageRegion;
if (index === 0) {
if (officeList.length) {
diff --git a/lib/routes/jike/user.js b/lib/routes/jike/user.js
index 6590a7d36d..a5470d9079 100644
--- a/lib/routes/jike/user.js
+++ b/lib/routes/jike/user.js
@@ -103,7 +103,7 @@ module.exports = async (ctx) => {
title: `${typeMap[item.type]}了: ${shortenTitle}`,
description: `${content}${linkTemplate}${imgTemplate}`,
pubDate: new Date(item.createdAt).toUTCString(),
- link: `${linkMap[item.type]}`,
+ link: linkMap[item.type],
};
if (id === 'wenhao1996' && item.topic.id === '553870e8e4b0cafb0a1bef68') {
diff --git a/lib/routes/jinritoutiao/keyword.js b/lib/routes/jinritoutiao/keyword.js
index 44d8e487a3..e757e88bab 100644
--- a/lib/routes/jinritoutiao/keyword.js
+++ b/lib/routes/jinritoutiao/keyword.js
@@ -16,12 +16,12 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `今日头条: ${keyword}`,
link: `https://www.toutiao.com/search/?keyword=${keyword}`,
- description: `${keyword}`,
+ description: keyword,
item: data.map((item) => ({
title: `${item.media_name}: ${item.title}`,
- description: `${item.abstract}`,
- pubDate: `${new Date(parseInt(item.create_time) * 1000)}`,
- link: `${item.article_url}`,
+ description: item.abstract,
+ pubDate: new Date(parseInt(item.create_time) * 1000),
+ link: item.article_url,
})),
};
};
diff --git a/lib/routes/juejin/utils.js b/lib/routes/juejin/utils.js
index 75096d55fc..b62591cd08 100644
--- a/lib/routes/juejin/utils.js
+++ b/lib/routes/juejin/utils.js
@@ -29,7 +29,7 @@ const ProcessFeed = (list, caches) =>
// 列表上提取到的信息
const single = {
title: item.article_info.title,
- description: `${(item.article_info.brief_content || '无描述').replace(/[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f]/g, '')}`,
+ description: (item.article_info.brief_content || '无描述').replace(/[\x00-\x08\x0b-\x0c\x0e-\x1f\x7f]/g, ''),
pubDate,
author: item.author_user_info.user_name,
link,
diff --git a/lib/routes/keyakizaka46/blog.js b/lib/routes/keyakizaka46/blog.js
index a96ba6fdde..d67fbddf0c 100644
--- a/lib/routes/keyakizaka46/blog.js
+++ b/lib/routes/keyakizaka46/blog.js
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
- itemPicUrl = `${item.find('img.js-replaceImage').attr('src')}`;
+ itemPicUrl = item.find('img.js-replaceImage').attr('src');
return {
title: item.find('p.ttl').text().trim(),
link: item.find('a').first().attr('href'),
diff --git a/lib/routes/kongfz/people.js b/lib/routes/kongfz/people.js
index d83f1e3b8d..5b2633d6ea 100644
--- a/lib/routes/kongfz/people.js
+++ b/lib/routes/kongfz/people.js
@@ -41,6 +41,6 @@ module.exports = async (ctx) => {
title: `孔夫子旧书网 - ${userInfo.nickname}`,
link: userInfo.shareUrl,
item: list,
- description: `${userInfo.sign}`,
+ description: userInfo.sign,
};
};
diff --git a/lib/routes/latepost/index.js b/lib/routes/latepost/index.js
index 6ad73f907c..e90ed525f8 100644
--- a/lib/routes/latepost/index.js
+++ b/lib/routes/latepost/index.js
@@ -41,7 +41,7 @@ module.exports = async (ctx) => {
const $ = cheerio.load(first.data);
const firstItem = {};
firstItem.title = $('.headlines-title a').text();
- firstItem.detail_url = `${$('.headlines-title a').attr('href')}`;
+ firstItem.detail_url = $('.headlines-title a').attr('href');
data = [firstItem].concat(response.data.data || []);
} else {
const apiUrl = `${rootUrl}/news/get-news-data`;
diff --git a/lib/routes/leetcode/check-us.js b/lib/routes/leetcode/check-us.js
index f3fedd5aa6..44e800bebf 100644
--- a/lib/routes/leetcode/check-us.js
+++ b/lib/routes/leetcode/check-us.js
@@ -6,7 +6,7 @@ module.exports = async (ctx) => {
const url = 'https://leetcode.com/';
const response = await got({
method: 'get',
- url: url + `${user}`,
+ url: `${url}${user}`,
headers: {
Referer: url,
},
diff --git a/lib/routes/lfsyd/index.js b/lib/routes/lfsyd/index.js
index 4e5093f85e..49c3de4b6c 100644
--- a/lib/routes/lfsyd/index.js
+++ b/lib/routes/lfsyd/index.js
@@ -44,7 +44,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `旅法师营地 - ${ctx.params.typecode === '1' ? '首页资讯' : feeds['0'].feed.seedTitle}`,
- link: `${url}`,
+ link: url,
item: items,
};
};
diff --git a/lib/routes/lizhi/user.js b/lib/routes/lizhi/user.js
index d51a4e6291..fa422877d9 100644
--- a/lib/routes/lizhi/user.js
+++ b/lib/routes/lizhi/user.js
@@ -41,6 +41,6 @@ module.exports = async (ctx) => {
})
)
),
- description: `${$('div.isAll').text()}`,
+ description: $('div.isAll').text(),
};
};
diff --git a/lib/routes/mastodon/account_id.js b/lib/routes/mastodon/account_id.js
index 84f9a5ff2c..23212555c3 100644
--- a/lib/routes/mastodon/account_id.js
+++ b/lib/routes/mastodon/account_id.js
@@ -9,8 +9,8 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${account_data.display_name} (@${account_data.acct})`,
- link: `${account_data.url}`,
- description: `${account_data.note}`,
+ link: account_data.url,
+ description: account_data.note,
item: utils.parseStatuses(data),
allowEmpty: true,
};
diff --git a/lib/routes/mastodon/acct.js b/lib/routes/mastodon/acct.js
index 92384c5000..660ae06879 100644
--- a/lib/routes/mastodon/acct.js
+++ b/lib/routes/mastodon/acct.js
@@ -10,8 +10,8 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${account_data.display_name} (@${account_data.acct})`,
- link: `${account_data.url}`,
- description: `${account_data.note}`,
+ link: account_data.url,
+ description: account_data.note,
item: utils.parseStatuses(data),
allowEmpty: true,
};
diff --git a/lib/routes/matataki/site/posts/favorite.js b/lib/routes/matataki/site/posts/favorite.js
index 2f66e86db9..b023588c07 100644
--- a/lib/routes/matataki/site/posts/favorite.js
+++ b/lib/routes/matataki/site/posts/favorite.js
@@ -14,7 +14,7 @@ module.exports = async (ctx) => {
const ipfsHtmlHash = await matatakiUtils.getPostIpfsHtmlHash(item.pid);
return {
- title: `${item.title}`,
+ title: item.title,
description: item.short_content,
link: `${matatakiUtils.IPFS_GATEWAY_URL}/ipfs/${ipfsHtmlHash}`,
pubDate: item.create_time,
@@ -24,7 +24,7 @@ module.exports = async (ctx) => {
);
} else {
items = response.data.data.list.map((item) => ({
- title: `${item.title}`,
+ title: item.title,
description: item.short_content,
link: `https://www.matataki.io/p/${item.pid}`,
pubDate: item.create_time,
diff --git a/lib/routes/matataki/utils/matataki-utils.js b/lib/routes/matataki/utils/matataki-utils.js
index f15c052b15..3c3edfc3c0 100644
--- a/lib/routes/matataki/utils/matataki-utils.js
+++ b/lib/routes/matataki/utils/matataki-utils.js
@@ -38,7 +38,7 @@ function get(path) {
async function getUserNickname(userId) {
try {
const userInfoResponse = await get(`/user/${userId}`);
- return `${userInfoResponse.data.data.nickname || userInfoResponse.data.data.username}`;
+ return userInfoResponse.data.data.nickname || userInfoResponse.data.data.username;
} catch (err) {
return '';
}
@@ -52,7 +52,7 @@ async function getUserNickname(userId) {
async function getTokenName(tokenId) {
try {
const tokenInfoResponse = await get(`/minetoken/${tokenId}`);
- return `${tokenInfoResponse.data.data.token.name}`;
+ return tokenInfoResponse.data.data.token.name;
} catch (err) {
return '';
}
@@ -65,7 +65,7 @@ async function getTokenName(tokenId) {
*/
async function getPostIpfsHtmlHash(postId) {
const ipfsInfoResponse = await get(`/p/${postId}/ipfs`);
- return `${ipfsInfoResponse.data.data[0].htmlHash}`;
+ return ipfsInfoResponse.data.data[0].htmlHash;
}
/**
diff --git a/lib/routes/meipai/user.js b/lib/routes/meipai/user.js
index 4809ddbbb2..00d929e787 100644
--- a/lib/routes/meipai/user.js
+++ b/lib/routes/meipai/user.js
@@ -30,7 +30,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${name}又有更新了`,
link: `https://www.meipai.com/user/${uid}/`,
- description: `${name}`,
+ description: name,
item: result,
};
};
diff --git a/lib/routes/method-studios/index.js b/lib/routes/method-studios/index.js
index 1e9244902d..e40808062a 100755
--- a/lib/routes/method-studios/index.js
+++ b/lib/routes/method-studios/index.js
@@ -52,9 +52,9 @@ module.exports = async (ctx) => {
link: 'https://www.methodstudios.com/',
description: $('description').text(),
item: list.map((item, index) => ({
- title: `${articledata[index].title}`,
- description: `${articledata[index].describe}`,
- link: `${articledata[index].link}`,
+ title: articledata[index].title,
+ description: articledata[index].describe,
+ link: articledata[index].link,
})),
};
};
diff --git a/lib/routes/mi/golden.js b/lib/routes/mi/golden.js
index 8986421ecc..9a3c8245b6 100644
--- a/lib/routes/mi/golden.js
+++ b/lib/routes/mi/golden.js
@@ -17,6 +17,6 @@ module.exports = async (ctx) => {
title: `金米奖 - 小米应用商店`,
link,
item: list,
- description: `${response.data.description}`,
+ description: response.data.description,
};
};
diff --git a/lib/routes/miniflux/get_entries.js b/lib/routes/miniflux/get_entries.js
index c7e8ddffdb..bcd3625d44 100644
--- a/lib/routes/miniflux/get_entries.js
+++ b/lib/routes/miniflux/get_entries.js
@@ -94,9 +94,9 @@ module.exports = async (ctx) => {
const setMark = [];
const setFeedName = [];
- const feeds = `${ctx.params.feeds}`;
+ const feeds = ctx.params.feeds;
- let parameters = `${ctx.params.parameters}`;
+ let parameters = ctx.params.parameters;
// Set default direction
if (parameters.search('direction=') === -1) {
parameters += '&direction=desc';
@@ -195,7 +195,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: agTitle,
- link: `${instance}`,
+ link: instance,
description: agInfo,
item: articles,
allowEmpty: true,
@@ -240,7 +240,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `MiniFlux | All`,
- link: `${instance}`,
+ link: instance,
description: `All feeds on ${instance} powered by MiniFlux`,
item: articles,
allowEmpty: true,
diff --git a/lib/routes/miniflux/get_feeds.js b/lib/routes/miniflux/get_feeds.js
index 5408977776..48af27b656 100644
--- a/lib/routes/miniflux/get_feeds.js
+++ b/lib/routes/miniflux/get_feeds.js
@@ -45,7 +45,7 @@ module.exports = async (ctx) => {
const feeds = [];
const feedsList = response.data;
- const parameters = `${ctx.params.parameters}`
+ const parameters = ctx.params.parameters
.split('&')
.map((parameter) => set(parameter))
.join('');
@@ -82,7 +82,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `MiniFlux | Subscription List`,
- link: `${instance}`,
+ link: instance,
description: `A subscription tracking feed.`,
item: subscription,
allowEmpty: true,
diff --git a/lib/routes/mp4ba/index.js b/lib/routes/mp4ba/index.js
index 9fadf0a141..722df02df1 100644
--- a/lib/routes/mp4ba/index.js
+++ b/lib/routes/mp4ba/index.js
@@ -59,7 +59,7 @@ async function buildRss($, paramType, ctx) {
selectorPath2 = 'a';
break;
case ParamType.paramType.search:
- desc = `${typeString}`;
+ desc = typeString;
selectorPath1 = '.search .search_content .sousuo';
selectorPath2 = 'b a';
break;
diff --git a/lib/routes/mp4er/index.js b/lib/routes/mp4er/index.js
index 2c2b3e42de..114154a64b 100644
--- a/lib/routes/mp4er/index.js
+++ b/lib/routes/mp4er/index.js
@@ -59,7 +59,14 @@ module.exports = async (ctx) => {
const torrents = content('#torrent-list .list');
- item.description = content('.info0').html() + `
画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}
${images.join('')}`, diff --git a/lib/routes/pixiv/ranking.js b/lib/routes/pixiv/ranking.js index 34241b4835..5064999cac 100644 --- a/lib/routes/pixiv/ranking.js +++ b/lib/routes/pixiv/ranking.js @@ -84,7 +84,7 @@ module.exports = async (ctx) => { pubDate: new Date(illust.create_date).toUTCString(), description: `画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}
${content.content}
`, - `作者:${author.user_name}`, - `楼层:${num}`, - `${from}` - ].join('${content.content}