forked from DIYgod/RSSHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Crawler995/RSSHub
- Loading branch information
Showing
22 changed files
with
555 additions
and
29 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 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 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 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 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 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 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 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 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 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,49 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
|
||
module.exports = async (ctx) => { | ||
const dataUrl = 'https://www.moh.gov.sg/2019-ncov-wuhan/past-updates'; | ||
const response = await got({ | ||
method: 'get', | ||
url: dataUrl, | ||
}); | ||
|
||
const $ = cheerio.load(response.data); | ||
const list = $('section.body-content div.sfContentBlock:nth-of-type(2) table tr').slice(1, 21); | ||
|
||
const items = list | ||
.filter((_, item) => { | ||
item = $(item); | ||
const dateRaw = item | ||
.find('td:first-child') | ||
.text() | ||
.trim(); | ||
return dateRaw !== 'Date'; | ||
}) | ||
.map((_, item) => { | ||
item = $(item); | ||
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'); | ||
return { | ||
title, | ||
pubDate, | ||
link, | ||
}; | ||
}) | ||
.get(); | ||
|
||
ctx.state.data = { | ||
title: 'Past Updates On 2019-NCOV Local Situation', | ||
link: dataUrl, | ||
description: 'Past Updates On 2019-NCOV Local Situation', | ||
item: items, | ||
}; | ||
}; |
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 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 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 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 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,42 @@ | ||
const got = require('@/utils/got'); | ||
|
||
module.exports = async (ctx) => { | ||
const keyword = ctx.params.keyword && ctx.params.keyword !== 'all' && ctx.params.keyword !== '全部' ? ctx.params.keyword : ''; | ||
|
||
const url = 'https://www.haohaozhu.cn/community/discover'; | ||
|
||
const response = await got({ | ||
method: 'post', | ||
url: 'https://www.haohaozhu.cn/f/y/api/Share/AllPhotoInPc', | ||
headers: { | ||
Referer: url, | ||
}, | ||
form: { | ||
keyword: keyword, | ||
page: 1, | ||
time: new Date().getTime(), | ||
}, | ||
}); | ||
|
||
const list = response.data.data.rows; | ||
|
||
ctx.state.data = { | ||
title: `好好住 - 发现${keyword ? ' - ' + keyword : ''}`, | ||
link: url, | ||
item: list | ||
.map((item) => { | ||
if (item.is_advertisement !== 0 || !item.photo || !item.photo.photo_info) { | ||
return ''; | ||
} | ||
return { | ||
title: item.photo.photo_info.remark, | ||
author: item.photo.user_info.nick, | ||
description: item.photo.photo_info.image_list.map((image) => `<img src="${image.ori_pic_url}" style="max-width: 100%;" />`).join(''), | ||
link: url, | ||
guid: item.photo.photo_info.id, | ||
pubDate: new Date(item.photo.photo_info.addtime * 1000), | ||
}; | ||
}) | ||
.filter((item) => item !== ''), | ||
}; | ||
}; |
Oops, something went wrong.