Files
RSSHub/lib/v2/sdu/extractor/index.js
Levi Zim 958be6266e feat(route): 山东大学(威海)新闻网 (#9537)
* feat(sduwh): add extractors.

* feat(route): add route for 山东大学(威海)新闻网

* docs: for route sduwh/news

* docs: for route sduwh/news

(cherry picked from commit 831830167a)

* feat(radar): for route 山东大学(威海)新闻网

* refactor: change `got.get` to `got`.

* refactor: prefer `parseDate()` to `new Date()`

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* fix: incomplete URL substring sanitization.

Make CodeQL happy.

* fix(radar): fix target field.

* fix: change route /sduwh to /sdu/wh

* fix: remove superfluous slash character in url.

* feat: look for exact date first.

* feat: extract exact date from news extractor.

* feat: extract exact date from view extractor.

* feat: extractor for www.sdrj.sdu.edu.cn

* refactor: semantic separation of sduwh with sdu

* feat(radar): more accurate name

* docs: update documentation

* refactor: migrate to v2

* refactor: fix deprecated url.resolve

* fix: update docs url

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* fix: sdu not working routes

* fix: accurate `ctx.state.data.url`

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* fix: better error handling for extractors.

* fix: timezone

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* fix: better error handling.

Co-authored-by: Tony <TonyRL@users.noreply.github.com>
2022-04-17 00:01:39 +08:00

13 lines
410 B
JavaScript

module.exports = async (link, ctx) => {
if (link.startsWith('https://xinwen.wh.sdu.edu.cn/')) {
return await require('./wh/news')(link, ctx);
}
if (link.startsWith('https://www.view.sdu.edu.cn/')) {
return await require('./view')(link, ctx);
}
if (link.startsWith('https://www.sdrj.sdu.edu.cn/')) {
return await require('./sdrj')(link, ctx);
}
return {};
};