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 pull request #651 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
33 changed files
with
428 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
// 重庆市事业单位公开招聘 | ||
const sydwgkzpUrl = 'https://rlsbj.cq.gov.cn/zwxx_182/sydw/'; | ||
|
||
module.exports = async (ctx) => { | ||
const { data: response } = await got(sydwgkzpUrl); | ||
|
||
const $ = cheerio.load(response); | ||
|
||
// 获取所有的标题 | ||
const list = $('div.page-list .tab-item > li') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
const title = item.find('a').first(); | ||
return { | ||
// 文章标题 | ||
title: title.text(), | ||
// 文章链接 | ||
link: `${sydwgkzpUrl}${title.attr('href')}`, | ||
// 文章发布日期 | ||
pubDate: parseDate(item.find('span').text()), | ||
}; | ||
}); | ||
|
||
// 获取每个通知的具体信息 | ||
const items = await Promise.all( | ||
list.map((item) => | ||
ctx.cache.tryGet(item.link, async () => { | ||
const { data: response } = await got(item.link); | ||
const $ = cheerio.load(response); | ||
// 主题正文 | ||
item.description = $('div[class="view TRS_UEDITOR trs_paper_default trs_web"]').first().html(); | ||
return item; | ||
}) | ||
) | ||
); | ||
|
||
ctx.state.data = { | ||
title: '重庆市事业单位公开招聘', | ||
link: sydwgkzpUrl, | ||
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
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,33 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
module.exports = async (ctx) => { | ||
const routeParams = ctx.params.routeParams; | ||
|
||
const baseURL = 'https://sourceforge.net'; | ||
const link = `https://sourceforge.net/directory/?${routeParams.toString()}`; | ||
|
||
const response = await got.get(link); | ||
const $ = cheerio.load(response.data); | ||
const itemList = $('ul.projects li[itemprop=itemListElement]'); | ||
|
||
ctx.state.data = { | ||
title: $('.content h1').text().trim(), | ||
link, | ||
item: itemList.toArray().map((element) => { | ||
const item = $(element); | ||
const title = item.find('.result-heading-title').text().trim(); | ||
const link = `${baseURL}${item.find('.result-heading-title').attr('href')}`; | ||
const description = item.find('.result-heading-texts').html(); | ||
const pubDate = parseDate(item.find('time').attr('datetime'), 'YYYY-MM-DD'); | ||
|
||
return { | ||
title, | ||
link, | ||
description, | ||
pubDate, | ||
}; | ||
}), | ||
}; | ||
}; |
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 = { | ||
'/:routeParams?': ['JimenezLi'], | ||
}; |
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,12 @@ | ||
module.exports = { | ||
'sourceforge.net': { | ||
_name: 'SourceForge', | ||
www: [ | ||
{ | ||
title: 'Software', | ||
docs: 'https://docs.rsshub.app/routes/program-update#sourceforge', | ||
source: '/directory', | ||
}, | ||
], | ||
}, | ||
}; |
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('/:routeParams?', require('./index')); | ||
}; |
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
Oops, something went wrong.
b38b8d0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
zr-rsshub – ./
zr-rsshub-ming42.vercel.app
zr-rsshub.vercel.app
rss.900905.xyz
zr-rsshub-git-master-ming42.vercel.app