fix(route): 萧山停水 (#12093)

This commit is contained in:
Wildmoe
2023-03-13 19:04:53 +08:00
committed by GitHub
parent 12f3effc8b
commit 6f04affaa1
+3 -3
View File
@@ -3,7 +3,7 @@ const cheerio = require('cheerio');
module.exports = async (ctx) => {
// const area = ctx.params.area;
const url = 'http://www.xswater.com/gongshui/channels/227.html';
const url = 'https://www.xswater.com/gongshui/channels/227.html';
const response = await got({
method: 'get',
url,
@@ -15,7 +15,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: $('title').text(),
link: 'http://www.xswater.com/gongshui/channels/227.html',
link: 'https://www.xswater.com/gongshui/channels/227.html',
description: $('meta[name="description"]').attr('content') || $('title').text(),
item:
list &&
@@ -26,7 +26,7 @@ module.exports = async (ctx) => {
title: item.find('a').text(),
description: `萧山区停水通知:${item.find('a').text()}`,
pubDate: new Date(item.find('span').text().slice(1, 11)).toUTCString(),
link: `http://www.xswater.com${item.find('a').attr('href')}`,
link: `https://www.xswater.com${item.find('a').attr('href')}`,
};
})
.get(),