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 #832 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
27 changed files
with
408 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -717,6 +717,22 @@ type 为 all 时,category 参数不支持 cost 和 free | |
|
||
</Route> | ||
|
||
## 汽油价格网 | ||
|
||
### 今日油价查询 | ||
|
||
<Route author="TonyRL" example="/qiyoujiage/shanghai" path="/qiyoujiage/:path*" :paramsDesc="['路径']"> | ||
|
||
::: tip 提示 | ||
|
||
路径处填写对应页面 URL 中 `http://www.qiyoujiage.com/` 和 `.shtml` 之间的字段。下面是一个例子。 | ||
|
||
若订阅 [福建漳州龙海今日油价](http://www.qiyoujiage.com/fujian/zhangzhou/longhai.shtml) 则将对应页面 URL <http://www.qiyoujiage.com/fujian/zhangzhou/longhai.shtml> 中 `http://www.qiyoujiage.com/` 和 `.shtml` 之间的字段 `fujian/zhangzhou/longhai` 作为路径填入。此时路由为 [`/qiyoujiage/fujian/zhangzhou/longhai`](https://rsshub.app/qiyoujiage/fujian/zhangzhou/longhai) | ||
|
||
::: | ||
|
||
</Route> | ||
|
||
## 且听风吟福利 | ||
|
||
### 分类 | ||
|
@@ -925,12 +941,6 @@ type 为 all 时,category 参数不支持 cost 和 free | |
<Route author="kt286" example="/mail/imap/[email protected]" path="/mail/imap/:email" :paramsDesc="['邮箱账号']" selfhost="1"/> | ||
|
||
## 油价 | ||
|
||
### 今日油价 | ||
|
||
<Route author="xyqfer" example="/oilprice/shanghai" path="/oilprice/:area" :paramsDesc="['地区拼音,详见[成品油价格网](http://oil.usd-cny.com/)']"/> | ||
|
||
## 有据 | ||
|
||
### 最新文章列表 | ||
|
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 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,41 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
module.exports = async (ctx) => { | ||
const baseUrl = 'http://fdy.bnu.edu.cn'; | ||
const { path = 'tzgg' } = ctx.params; | ||
const link = `${baseUrl}/${path}/index.htm`; | ||
|
||
const { data: response } = await got(link); | ||
const $ = cheerio.load(response); | ||
|
||
const list = $('.listconrl li') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
const a = item.find('a'); | ||
return { | ||
title: a.attr('title'), | ||
link: new URL(a.attr('href'), link).href, | ||
pubDate: parseDate(item.find('.news-dates').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 = $('.listconrc-newszw').html(); | ||
return item; | ||
}) | ||
) | ||
); | ||
|
||
ctx.state.data = { | ||
title: $('head title').text(), | ||
link, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
|
||
module.exports = async (ctx) => { | ||
const baseUrl = 'http://www.lib.bnu.edu.cn'; | ||
const { category = 'zydt' } = ctx.params; | ||
const link = `${baseUrl}/${category}/index.htm`; | ||
|
||
const { data: response } = await got(link); | ||
const $ = cheerio.load(response); | ||
|
||
const list = $('.view-content .item-list li') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
return { | ||
title: item.find('a').text(), | ||
link: `${baseUrl}/${category}/${item.find('a').attr('href')}`, | ||
pubDate: parseDate(item.find('span > span').eq(1).text(), 'YYYY-MM-DD'), | ||
}; | ||
}); | ||
|
||
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 = $('#block-system-main .content .content').html(); | ||
return item; | ||
}) | ||
) | ||
); | ||
|
||
ctx.state.data = { | ||
title: $('head title').text(), | ||
link, | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
module.exports = { | ||
'/bs/:category?': ['nczitzk'], | ||
'/dwxgb/:category/:type': ['Fatpandac'], | ||
'/fdy/:path*': ['TonyRL'], | ||
'/lib/:category?': ['TonyRL'], | ||
}; |
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 |
---|---|---|
@@ -1,19 +1,37 @@ | ||
module.exports = { | ||
'bnu.edu.cn': { | ||
_name: '北京师范大学', | ||
'.': [ | ||
bs: [ | ||
{ | ||
title: '经济与工商管理学院', | ||
docs: 'https://docs.rsshub.app/university.html#bei-jing-shi-fan-da-xue', | ||
source: ['/'], | ||
target: '/bs/:category?', | ||
source: ['/:category/index.html'], | ||
target: '/bnu/bs/:category', | ||
}, | ||
], | ||
dwxgb: [ | ||
{ | ||
title: '经济与工商管理学院', | ||
title: '党委学生工作部', | ||
docs: 'https://docs.rsshub.app/university.html#bei-jing-shi-fan-da-xue', | ||
source: ['/'], | ||
source: ['/:category/:type/index.html'], | ||
target: '/bnu/dwxgb/:category/:type', | ||
}, | ||
], | ||
fdy: [ | ||
{ | ||
title: '党委学生工作部辅导员发展中心', | ||
docs: 'https://docs.rsshub.app/university.html#bei-jing-shi-fan-da-xue', | ||
source: ['/'], | ||
target: (_, url) => `/bnu/fdy${new URL(url).pathname.replace(/\/index\.htm(l)?$/, '')}`, | ||
}, | ||
], | ||
'www.lib': [ | ||
{ | ||
title: '图书馆通知', | ||
docs: 'https://docs.rsshub.app/university.html#bei-jing-shi-fan-da-xue', | ||
source: ['/:category/index.htm'], | ||
target: '/bnu/lib/:category', | ||
}, | ||
], | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
module.exports = function (router) { | ||
router.get('/bs/:category?', require('./bs')); | ||
router.get('/dwxgb/:category/:type', require('./dwxgb')); | ||
router.get('/fdy/:path*', require('./fdy')); | ||
router.get('/lib/:category?', require('./lib')); | ||
}; |
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,44 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const timezone = require('@/utils/timezone'); | ||
|
||
module.exports = async (ctx) => { | ||
const baseUrl = 'https://www.moe.gov.cn'; | ||
const { column } = ctx.params; | ||
const link = `${baseUrl}/s78/${column}/tongzhi/`; | ||
|
||
const { data: response } = await got(link); | ||
const $ = cheerio.load(response); | ||
|
||
const list = $('#list li') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
return { | ||
title: item.find('a').attr('title'), | ||
link: new URL(item.find('a').attr('href'), link).href, | ||
pubDate: timezone(parseDate(item.find('span').text(), 'YYYY-MM-DD'), +8), | ||
}; | ||
}); | ||
|
||
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); | ||
|
||
$('#moe-detail-page-set, #moeCode, .moe-detail-shuxing, h1').remove(); | ||
item.description = $('.moe-detail-box').html(); | ||
|
||
return item; | ||
}) | ||
) | ||
); | ||
|
||
ctx.state.data = { | ||
title: `${$('meta[name="ColumnType"]').attr('content')} - ${$('head title').text()}`, | ||
link, | ||
item: items, | ||
}; | ||
}; |
Oops, something went wrong.
77514a6
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:
rsshub-master – ./
rsshub-master-git-master-auto-bot-ty.vercel.app
rsshub-master-auto-bot-ty.vercel.app
rsshub-master.vercel.app