style(eslint): add no-implicit-coercion rule (#8175)

* refactor: add no-implicit-coercion rule for ESLint

* fix: errors from deepscan

* fix: errors from deepscan

* fix: errors from deepscan

* fix: errors from deepscan

* fix: errors from deepscan

* Update docs/en/joinus/quick-start.md

Co-authored-by: Sukka <isukkaw@gmail.com>

* Update docs/joinus/quick-start.md

Co-authored-by: Sukka <isukkaw@gmail.com>

* Update lib/routes/av01/tag.js

Co-authored-by: Sukka <isukkaw@gmail.com>

* Update lib/routes/gov/taiwan/mnd.js

Co-authored-by: Sukka <isukkaw@gmail.com>

* Update lib/routes/ps/product.js

Co-authored-by: Sukka <isukkaw@gmail.com>

* refactor: minify html string

Co-authored-by: Sukka <isukkaw@gmail.com>
This commit is contained in:
Daniel Li (李丹阳) 2021-09-15 21:22:11 +08:00 committed by GitHub
parent a7635464d2
commit d77a039f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
153 changed files with 338 additions and 269 deletions

View File

@ -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,

View File

@ -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');

View File

@ -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()}<br>描述:${item.find('.content p').text()}<br><img src="${itemPicUrl}">`,

View File

@ -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()}<br>描述:${item.find('.content p').text()}<br><img src="${itemPicUrl}">`,

View File

@ -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();

View File

@ -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}...<br><br><small>作者 ${item.author} · 回复 ${item.replies} · 查看 ${item.views}</small>`,
link: `https://instant.1point3acres.com/thread/${item.tid}`,
};

View File

@ -30,6 +30,6 @@ module.exports = async (ctx) => {
})
)
),
description: `${motifInfo.categoryTitle}`,
description: motifInfo.categoryTitle,
};
};

View File

@ -28,7 +28,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `阿里云开发者社区-${title}`,
link,
description: `${desc}`,
description: desc,
item:
list &&
list

View File

@ -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',

View File

@ -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()}<br><img src="${itemPicUrl}">`,

View File

@ -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()}<br><img src="${itemPicUrl}">`,

View File

@ -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 ? `<video controls loop ${item.preview_url ? `poster="${item.preview_url}"` : ''} src="${item.preview_video_url}" />` : ''}`,
description: item.preview_video_url ? `<video controls loop ${item.preview_url ? `poster="${item.preview_url}"` : ''} src="${item.preview_video_url}" />` : '',
pubDate: new Date(item.addtime * 1000).toUTCString(),
link: item.video_url,
category: item.keyword.split(' '),

View File

@ -73,9 +73,9 @@ module.exports = async (ctx) => {
video = `<iframe id="ytplayer" type="text/html" width="640" height="360" src='https://youtube.com/embed/${articledata[index].youtube}' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><br>`;
}
return {
title: `${articledata[index].title}`,
title: articledata[index].title,
description: `${video}+${articledata[index].describe}`,
link: `${articledata[index].link}`,
link: articledata[index].link,
};
}),
};

View File

@ -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;

View File

@ -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) => ({

View File

@ -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) => ({

View File

@ -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(),
};
}),

View File

@ -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}<br> ${item.desc}`,
pubDate: new Date(item.ctime.replace(' ', 'T') + '+08:00').toUTCString(),
link: `${item.pc_url}`,
link: item.pc_url,
})),
};
};

View File

@ -190,10 +190,14 @@ module.exports = async (ctx) => {
return {
title: getTitle(data),
description: `${data_content || getDes(data)}${
origin && getOriginName(origin) ? `<br><br>//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : `${getOriginDes(origin)}`
}<br>${getUrl(data)}${getUrl(origin)}${getIframe(data)}${getIframe(origin)}${imgHTML ? `<br>${imgHTML}` : ''}${videoHTML ? `<br>${videoHTML}` : ''}`,
pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
description: (() => {
const description = data_content || getDes(data);
const originName = origin && getOriginName(origin) ? `<br><br>//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : getOriginDes(origin);
const imgHTMLSource = imgHTML ? `<br>${imgHTML}` : '';
const videoHTMLSource = videoHTML ? `<br>${videoHTML}` : '';
return `${description}${originName}<br>${getUrl(data)}${getUrl(origin)}${getIframe(data)}${getIframe(origin)}${imgHTMLSource}${videoHTMLSource}`;
})(),
pubDate: new Date(item.desc.timestamp * 1000),
link,
};
}),

View File

@ -121,9 +121,14 @@ module.exports = async (ctx) => {
return {
title: getTitle(data),
author,
description: `${parsed.new_desc || data_content || getDes(data)}${
origin && getOriginName(origin) ? `<br><br>//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : `${getOriginDes(origin)}`
}${getIframe(data)}${getIframe(origin)}${imgHTML ? `<br>${imgHTML}` : ''}${videoHTML ? `<br>${videoHTML}` : ''}`,
description: (() => {
const description = parsed.new_desc || data_content || getDes(data);
const originName = origin && getOriginName(origin) ? `<br><br>//转发自: @${getOriginName(origin)}: ${getOriginTitle(origin.item || origin)}${getDes(origin.item || origin)}` : getOriginDes(origin);
const imgHTMLSource = imgHTML ? `<br>${imgHTML}` : '';
const videoHTMLSource = videoHTML ? `<br>${videoHTML}` : '';
return `${description}${originName}${getIframe(data)}${getIframe(origin)}${imgHTMLSource}${videoHTMLSource}`;
})(),
pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
link,
};

View File

@ -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}`,

View File

@ -41,7 +41,7 @@ module.exports = async (ctx) => {
let item = hotlist[i];
item = {
title: `${item.title}`,
title: item.title,
description: `${item.description}${!disableEmbed ? `<br><br>${utils.iframe(item.id)}` : ''}<br><img src="https:${item.pic}"><br/>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}`,

View File

@ -26,7 +26,7 @@ module.exports = async (ctx) => {
item:
list &&
list.map((item) => ({
title: `${item.title}`,
title: item.title,
description: `${item.desc}${!disableEmbed ? `<br><br>${utils.iframe(item.aid)}` : ''}<br><img src="${item.pic}">`,
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}`,

View File

@ -29,7 +29,12 @@ module.exports = async (ctx) => {
description: 'B站每周必看',
item: data.map((item) => ({
title: item.title,
description: `${weekly_name} ${item.title}<br>${item.rcmd_reason}<br>${!disableEmbed ? `${utils.iframe(item.param)}` : ''}<img src="${item.cover}">`,
// description: `${weekly_name} ${item.title}<br>${item.rcmd_reason}<br>${!disableEmbed ? `${utils.iframe(item.param)}` : ''}<img src="${item.cover}">`,
description: `
${weekly_name} ${item.title}<br>
${item.rcmd_reason}<br>
${!disableEmbed ? utils.iframe(item.param) : ''}<img src="${item.cover}">
`,
link: weekly_number > 60 && item.bvid ? `https://www.bilibili.com/video/${item.bvid}` : `https://www.bilibili.com/video/av${item.param}`,
})),
};

View File

@ -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,
})),
};
};

View File

@ -53,7 +53,7 @@ module.exports = async (ctx) => {
const imgstyle = `style="max-width: 650px; height: auto; object-fit: contain; flex: 0 0 auto;"`;
content += `<iframe ${videostyle} src='https://player.vimeo.com/video/${articledata[index].mainvideo}' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe><br>`;
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,
};
}),
};

View File

@ -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,
};
}),
};

View File

@ -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,

View File

@ -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,
};
};

View File

@ -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,
};
};

View File

@ -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');

View File

@ -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),
};
}),
};

View File

@ -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);

View File

@ -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} <br> 信息:${extra.short_info} <br> 评分:${rate} <br> <img src="${cover_img.url}">`;

View File

@ -48,10 +48,10 @@ module.exports = async (ctx) => {
const description = `作者:${item.author.name} | ${item.create_time} <br><br> ${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;

View File

@ -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()}<br>描述:${item.find('.content p').text()}<br><img src="${itemPicUrl}">`,

View File

@ -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 ? `<video src="${videoSrc}" ${videoCover ? `poster="${videoCover}"` : ''}></video>` : ''}`;
if (videoSrc) {
description = `
${description}
<video
src="${videoSrc}"
${videoCover ? `poster="${videoCover}"` : ''}
>
</video>
`;
}
}
if (status.parent_status) {

View File

@ -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');

View File

@ -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`;

View File

@ -188,7 +188,7 @@ async function conv_article(i) {
}
if (!i.body) {
ret += `${i.excerpt}`;
ret += i.excerpt;
return ret;
}

View File

@ -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'),
};

View File

@ -56,8 +56,8 @@ module.exports = async (ctx) => {
description: `${repo.node.description === null ? 'no description' : repo.node.description} <br> primary language: ${
repo.node.primaryLanguage === null ? 'no primary language' : repo.node.primaryLanguage.name
} <br> stargazers: ${repo.node.stargazers.totalCount} <br> <img sytle="width:50px;" src='${repo.node.openGraphImageUrl}'>`,
pubDate: new Date(`${repo.starredAt}`).toUTCString(),
link: `${repo.node.url}`,
pubDate: new Date(repo.starredAt),
link: repo.node.url,
})),
};
};

View File

@ -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 };

View File

@ -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),
})),
};
};

View File

@ -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 };
});

View File

@ -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;
})

View File

@ -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);

View File

@ -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();

View File

@ -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,

View File

@ -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'),

View File

@ -92,7 +92,7 @@ module.exports = async (ctx) => {
method: 'get',
url: link,
headers: {
Referer: `${baseUrl}`,
Referer: baseUrl,
},
});
return cheerio.load(resp.data)('#article').html();

View File

@ -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',

View File

@ -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,

View File

@ -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('<br/>')}`,
description: author.bioParagraphs.join('<br/>'),
item: papers.records.map((item) => ({
title: item.articleTitle,
author: item.authors.map((author) => author.preferredName).join(', '),

View File

@ -14,7 +14,7 @@ module.exports = async (ctx) => {
url: api_url,
form: {
pageNo: 1,
catid: `${category}`,
catid: category,
},
});

View File

@ -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,
};
};

View File

@ -63,7 +63,7 @@ module.exports = async (ctx) => {
itemDescription += packageTrackRecord ? `${packageTrackRecord}<br>` : '';
itemDescription += packageOfficeZipCode ? `${packageOfficeZipCode} ` : '';
itemDescription += packageOffice ? `${packageOffice} ` : '';
itemDescription += `${packageRegion}`;
itemDescription += packageRegion;
if (index === 0) {
if (officeList.length) {

View File

@ -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') {

View File

@ -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,
})),
};
};

View File

@ -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,

View File

@ -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'),

View File

@ -41,6 +41,6 @@ module.exports = async (ctx) => {
title: `孔夫子旧书网 - ${userInfo.nickname}`,
link: userInfo.shareUrl,
item: list,
description: `${userInfo.sign}`,
description: userInfo.sign,
};
};

View File

@ -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`;

View File

@ -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,
},

View File

@ -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,
};
};

View File

@ -41,6 +41,6 @@ module.exports = async (ctx) => {
})
)
),
description: `${$('div.isAll').text()}`,
description: $('div.isAll').text(),
};
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,

View File

@ -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;
}
/**

View File

@ -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,
};
};

View File

@ -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,
})),
};
};

View File

@ -17,6 +17,6 @@ module.exports = async (ctx) => {
title: `金米奖 - 小米应用商店`,
link,
item: list,
description: `${response.data.description}`,
description: response.data.description,
};
};

View File

@ -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,

View File

@ -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,

View File

@ -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;

View File

@ -59,7 +59,14 @@ module.exports = async (ctx) => {
const torrents = content('#torrent-list .list');
item.description = content('.info0').html() + `<div><b>下载地址:</b>${downloadLinks}</div>` + `${torrents.html() ? `<div><b>种子列表:</b>${torrents.html()}</div>` : ''}`;
item.description = `
${content('.info0').html()}
<div>
<b>下载地址</b>
${downloadLinks}
</div>
${torrents.html() ? `<div><b>种子列表:</b>${torrents.html()}</div>` : ''}
`.replace(/\n +/gm, ''); // Minify the string.
item.enclosure_url = torrents.html() ? `${rootUrl}${torrents.find('a.header').last().attr('href')}` : downloadResponse.data.pop().url;
item.enclosure_type = 'application/x-bittorrent';

View File

@ -17,7 +17,7 @@ module.exports = async (ctx) => {
const title = $a.text();
const date = $el.find('.newsbodylist-title span').text().split('|')[1];
const key = `${href}`;
const key = href;
let description;
const value = await ctx.cache.get(key);

View File

@ -41,7 +41,7 @@ async function load(link) {
}
module.exports = async (ctx) => {
const type = `${ctx.params.type || ''}`;
const type = ctx.params.type || '';
const url = `https://www.natgeomedia.com/${ctx.params.cat}/${type}`;
const res = await got.get(url);
const $ = cheerio.load(res.data);

View File

@ -20,7 +20,7 @@ function load(link, ctx) {
module.exports = async (ctx) => {
const type = ctx.params.type;
const host = `http://${type}.neea.edu.cn${typeDic[`${type}`].url}`;
const host = `http://${type}.neea.edu.cn${typeDic[type].url}`;
const response = await got({
method: 'get',
url: host,
@ -48,9 +48,9 @@ module.exports = async (ctx) => {
})
);
ctx.state.data = {
title: `${typeDic[`${type}`].title}动态`,
title: `${typeDic[String(type)].title}动态`,
link: host,
description: `${typeDic[`${type}`].title}动态 `,
description: `${typeDic[String(type)].title}动态 `,
item: process,
};
};

View File

@ -60,7 +60,7 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
title: `${$('title').text()}`,
title: $('title').text(),
link: rootUrl,
item: items,
};

View File

@ -27,7 +27,7 @@ module.exports = async (ctx) => {
const list = $('.grid>tbody>tr>td>li>a');
ctx.state.data = {
title: `${title}`,
title,
link: `${baseUrl}${id}.html`,
description: '',
item:

View File

@ -54,7 +54,7 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
title: `${title}`,
title,
link: `${baseUrl}/files/article/html${id}/`,
image: cover_url,
description,

View File

@ -22,7 +22,7 @@ module.exports = async (ctx) => {
parcel = parcel[0];
if (parcel.point) {
message += `${parcel.point.description}`;
message += parcel.point.description;
}
if (parcel.location) {

View File

@ -13,10 +13,10 @@ module.exports = async (ctx) => {
? await Promise.all(
data.data.map(async (item) => ({
title: item.title,
description: `${await ctx.cache.tryGet(`pcrcn_${item.id}`, async () => {
description: await ctx.cache.tryGet(`pcrcn_${item.id}`, async () => {
const resp = await got({ method: 'get', url: `https://api.biligame.com/news/${item.id}` });
return resp.data.data.content;
})}`,
}),
link: `https://game.bilibili.com/pcr/news.html#detail=${item.id}`,
pubDate: item.ctime ? item.ctime : item.createTime,
}))

View File

@ -101,7 +101,7 @@ module.exports = async (ctx) => {
return Promise.resolve({
title: subject.text(),
link,
pubDate: `${pubDate}`,
pubDate: new Date(pubDate),
description,
});
})
@ -110,7 +110,7 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
title: `${title}`,
title,
link: baseUrl + path,
item: resultItem,
};

View File

@ -51,19 +51,19 @@ module.exports = async (ctx) => {
});
});
});
const appName = $(`${indexOfEle[pageTemplate].appName}`).text();
const appIntro = $(`${indexOfEle[pageTemplate].appIntro}`).text();
const version = $(`${indexOfEle[pageTemplate].version}`).children('li').eq(0).text();
const appSize = $(`${indexOfEle[pageTemplate].appSize}`).children('li').eq(1).text().slice(3);
const appImg = $(`${indexOfEle[pageTemplate].appImg}`)
const appName = $(indexOfEle[pageTemplate].appName).text();
const appIntro = $(indexOfEle[pageTemplate].appIntro).text();
const version = $(indexOfEle[pageTemplate].version).children('li').eq(0).text();
const appSize = $(indexOfEle[pageTemplate].appSize).children('li').eq(1).text().slice(3);
const appImg = $(indexOfEle[pageTemplate].appImg)
.toArray()
.reduce((acc, curr) => (acc += `<img src='${$(curr).children().find('img').attr('src')}' style="margin: 0 auto;">`), '');
let appStatus = $(`${indexOfEle[pageTemplate].appStatus}`).text().trim();
let appStatus = $(indexOfEle[pageTemplate].appStatus).text().trim();
if (appStatus === '点击安装') {
appStatus = '可下载安装';
}
let updateIntro = $(`${indexOfEle[pageTemplate].updateIntro}`).text().trim().slice(4);
let updateIntro = $(indexOfEle[pageTemplate].updateIntro).text().trim().slice(4);
if (updateIntro === '') {
updateIntro = '暂无更新内容';
}
@ -84,7 +84,7 @@ module.exports = async (ctx) => {
{
link,
title: `${appName}-${version}`,
description: `${description}`,
description,
},
],
};

View File

@ -35,7 +35,7 @@ module.exports = async (ctx) => {
items.push({
title: `[${size}] ${description_simple}`,
description: `${description}`,
description,
link: link_base + link,
});
});

View File

@ -34,7 +34,7 @@ module.exports = async (ctx) => {
}
}
return {
title: `${illust.title}`,
title: illust.title,
author: illust.user.name,
pubDate: new Date(illust.create_date).toUTCString(),
description: `<p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p>${images.join('')}`,

View File

@ -84,7 +84,7 @@ module.exports = async (ctx) => {
pubDate: new Date(illust.create_date).toUTCString(),
description: `<p>画师:${illust.user.name} - 阅览数:${illust.total_view} - 收藏数:${illust.total_bookmarks}</p><br>${images.join('')}`,
link: `https://www.pixiv.net/artworks/${illust.id}`,
author: `${illust.user.name}`,
author: illust.user.name,
};
}),
};

View File

@ -30,8 +30,8 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${nickname} 的 Tape 提问箱`,
link: `https://www.tapechat.net/${sharecode}`,
image: `${avatar}`,
description: `${production}`,
image: avatar,
description: production,
item: data.map((item) => ({
title: item.title,
description: `${item.title}<br>(${item.createdAt})<br><br><b>答:</b><br>${item.answer.txtContent}<br>(${new Date(item.answerAt * 1000).toLocaleString()})`,

View File

@ -73,9 +73,9 @@ module.exports = async (ctx) => {
url: `https://store.playstation.com/valkyrie-api/${langurl}/999/resolve/${gridName}?depth=2`,
});
const data = response.data;
const item = data.included && data.included.filter((item) => item.id === `${gridName}`);
const item = data.included?.filter((item) => item.id === gridName) ?? [];
ctx.state.data = {
title: `PlayStation Store - ${item[0].attributes.name}`,
title: `PlayStation Store - ${item[0].attributes?.name ?? 'Unknown Name'}`,
link: `https://store.playstation.com/${ctx.params.lang}/product/${gridName}`,
item: item.map((item) => {
let discount = '';
@ -100,7 +100,7 @@ module.exports = async (ctx) => {
(item.attributes['badge-info']['plus-user'] && item.attributes['badge-info']['plus-user']['discount-percentage'] === 100) ||
(item.attributes['badge-info']['plus-user'] && item.attributes['badge-info']['plus-user']['discount-percentage'] === 0)
) {
pdiscount = `${textshow.tplusfree}`;
pdiscount = textshow.tplusfree;
}
// 优惠时限&判断

View File

@ -24,7 +24,7 @@ module.exports = async (ctx) => {
list
.map((index, item) => {
item = $(item);
itemPicUrl = `${item.find('div.wrap-bg span.img').attr('style')}`.replace('background-image: url(', '').replace(');', '');
itemPicUrl = item.find('div.wrap-bg span.img').attr('style').replace('background-image: url(', '').replace(');', '');
return {
title: item.find('div.date-title h3.title').text().trim(),
link: item.find('a').first().attr('href'),

View File

@ -14,8 +14,8 @@ module.exports = async (ctx) => {
if (data.is_onlive) {
item = [
{
title: `${data.room_name}`,
pubDate: new Date(data.current_live_started_at * 1000).toUTCString(),
title: data.room_name,
pubDate: new Date(data.current_live_started_at * 1000),
guid: new Date(data.current_live_started_at * 1000).toUTCString(),
link: data.share_url_live,
},

View File

@ -75,11 +75,11 @@ module.exports = async (ctx) => {
ctx.state.data = {
// 源标题
title: `${rssData.name}`,
title: rssData.name,
// 源链接
link: `https://www.ishuhui.com/comics/anime/${id}`,
// 源说明
description: `${rssData.desc}`,
description: rssData.desc,
// 遍历此前获取的数据
item: data.map((item) => ({
// 文章标题

View File

@ -25,7 +25,7 @@ module.exports = async (ctx) => {
// 文章正文
description: `${item.title}<br>${item.date}`,
// 文章发布时间
pubDate: parseDate(`${item.date}`),
pubDate: parseDate(item.date),
// 文章链接
link: `https://monster-siren.hypergryph.com/info/${item.cid}`,
})),

View File

@ -26,13 +26,13 @@ module.exports = async (ctx) => {
const pubyear = item.find('section.update-highlights time').attr('datetime').substr(-4);
const pubdateString = pubmonth + `-` + pubday + `-` + pubyear;
return {
title: `${item.find('h2.update-version-title').first().text().trim()}`,
title: item.find('h2.update-version-title').first().text().trim(),
description: `${item.find('section.update-highlights .lead').html()}<br>
${item.find('section.update-highlights footer').html()}<br>
${item.find('aside.update-details .mask').html()}`,
link: `https://www.sketch.com/updates/${item.find('.update-version-title a').attr('href')}`,
pubDate: new Date(pubdateString).toLocaleDateString(),
guid: `${item.find('h2.update-version-title').first().text().trim()}`,
pubDate: new Date(pubdateString),
guid: item.find('h2.update-version-title').first().text().trim(),
};
})
.get(),

View File

@ -31,7 +31,7 @@ module.exports = async (ctx) => {
title: `${item.find('.feed-block-title a').eq(0).text().trim()} - ${item.find('.feed-block-title a').eq(1).text().trim()}`,
description: `${item.find('.feed-block-descripe').contents().eq(2).text().trim()}<br>${item.find('.feed-block-extras span').text().trim()}<br><img src="http:${item.find('.z-feed-img img').attr('src')}">`,
pubDate: timezone(parseDate(item.find('.feed-block-extras').contents().eq(0).text().trim(), 'H:mm'), +8),
link: `${item.find('.feed-block-title a').attr('href')}`,
link: String(item.find('.feed-block-title a').attr('href')),
};
})
.get(),

View File

@ -37,7 +37,7 @@ module.exports = async (ctx) => {
let items = response.data.data.posts;
items = items.map((item) => {
const pureContent = `${item.content}`;
const pureContent = item.content;
let content = pureContent.replace(/\n/, '<br />');
if (item.attachments) {

View File

@ -47,7 +47,7 @@ module.exports = async (ctx) => {
}
items = items.map((item) => {
const pureContent = `${item.content}`;
const pureContent = item.content;
let content = pureContent.replace(/\n/, '<br />');
if (item.attachments) {

Some files were not shown because too many files have changed in this diff Show More