rss: Trim shmtu string (#813)
This commit is contained in:
@@ -2,7 +2,7 @@ const axios = require('../../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const host = 'http://www.shmtu.edu.cn';
|
||||
const host = 'https://www.shmtu.edu.cn';
|
||||
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
@@ -25,8 +25,20 @@ module.exports = async (ctx) => {
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('.title').text(),
|
||||
description: '发布部门 - ' + item.find('.department').text(),
|
||||
title: item
|
||||
.find('.title')
|
||||
.text()
|
||||
.trim(),
|
||||
description: item
|
||||
.find('.title')
|
||||
.text()
|
||||
.trim(),
|
||||
author:
|
||||
'发布部门 - ' +
|
||||
item
|
||||
.find('.department')
|
||||
.text()
|
||||
.trim(),
|
||||
pubDate: item
|
||||
.find('span')
|
||||
.find('span')
|
||||
|
||||
@@ -33,15 +33,18 @@ module.exports = async (ctx) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('a').attr('title'),
|
||||
description:
|
||||
description: item.find('a').attr('title'),
|
||||
author:
|
||||
'信息类别 - ' +
|
||||
$('.gvItemNormal', item)
|
||||
.slice(1, 2)
|
||||
.text(),
|
||||
.text()
|
||||
.trim(),
|
||||
pubDate: $('.gvItemNormal', item)
|
||||
.slice(4)
|
||||
.text(),
|
||||
link: host + item.find('a').attr('href'),
|
||||
.text()
|
||||
.trim(),
|
||||
link: (host + item.find('a').attr('href')).replace('/Information/..', ''),
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
|
||||
@@ -2,7 +2,7 @@ const axios = require('../../../utils/axios');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const host = 'http://www.shmtu.edu.cn';
|
||||
const host = 'https://www.shmtu.edu.cn';
|
||||
|
||||
const response = await axios({
|
||||
method: 'get',
|
||||
@@ -25,8 +25,20 @@ module.exports = async (ctx) => {
|
||||
.map((index, item) => {
|
||||
item = $(item);
|
||||
return {
|
||||
title: item.find('.title').text(),
|
||||
description: '发布部门 - ' + item.find('.department').text(),
|
||||
title: item
|
||||
.find('.title')
|
||||
.text()
|
||||
.trim(),
|
||||
description: item
|
||||
.find('.title')
|
||||
.text()
|
||||
.trim(),
|
||||
author:
|
||||
'发布部门 - ' +
|
||||
item
|
||||
.find('.department')
|
||||
.text()
|
||||
.trim(),
|
||||
pubDate: item
|
||||
.find('span')
|
||||
.find('span')
|
||||
|
||||
Reference in New Issue
Block a user