-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(egsea): pubDate Invalid Date (#13914)
* fix(egsea): pubDate Invalid Date the https://rsshub.app/egsea/flash response error pubDate <pubDate>Invalid Date</pubDate> * refactor: migrate to v2 ---------
- Loading branch information
Showing
6 changed files
with
50 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const got = require('@/utils/got'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
module.exports = async (ctx) => { | ||
const response = await got({ | ||
method: 'get', | ||
url: 'https://www.egsea.com/news/flash-list?per-page=30', | ||
}); | ||
|
||
const out = response.data.data.map((item) => { | ||
const pubDate = parseDate(item.pageTime, 'X'); | ||
const link = 'https://www.egsea.com' + item.url; | ||
const title = item.title; | ||
const description = item.content; | ||
|
||
return { | ||
title, | ||
link, | ||
pubDate, | ||
description, | ||
category: item.tags.map((tag) => tag.name), | ||
}; | ||
}); | ||
|
||
ctx.state.data = { | ||
title: '快讯 - e 公司', | ||
link: 'https://www.egsea.com/news/flash', | ||
item: out, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'/flash': ['hillerliao'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
'egsea.com': { | ||
_name: 'e 公司', | ||
'.': [ | ||
{ | ||
title: '快讯', | ||
docs: 'https://docs.rsshub.app/routes/new-media#e-gong-si', | ||
source: ['/news/flash'], | ||
target: '/egsea/flash', | ||
}, | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = (router) => { | ||
router.get('/flash', require('./flash')); | ||
}; |