From 97473dae5ca05956b76cf11347946b6dc0569f7d Mon Sep 17 00:00:00 2001 From: Yorkin Yuan <854372534@qq.com> Date: Sun, 19 Apr 2020 18:49:17 +0800 Subject: [PATCH 01/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B0=8F?= =?UTF-8?q?=E9=BB=91=E7=9B=92=E6=B8=B8=E6=88=8F=E6=96=B0=E9=97=BB=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8F=96=E5=80=BC=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20(#4472)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/xiaoheihe/news.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/xiaoheihe/news.js b/lib/routes/xiaoheihe/news.js index c14a9c801..1eb2d2f82 100644 --- a/lib/routes/xiaoheihe/news.js +++ b/lib/routes/xiaoheihe/news.js @@ -16,7 +16,7 @@ module.exports = async (ctx) => { // 最终需要返回的对象 const news = { title: item.title, - pubDate: item.date, + pubDate: item.data, link: item.newUrl, }; From 44312f624ffdad8ae2ad72a90985acdca6e112ad Mon Sep 17 00:00:00 2001 From: kimi360 Date: Sun, 19 Apr 2020 18:49:40 +0800 Subject: [PATCH 02/10] =?UTF-8?q?fix:=20=E7=9C=8B=E9=9B=AA=E6=97=A0Topic?= =?UTF-8?q?=E5=8F=AA=E8=8E=B7=E5=8F=96=E7=B2=BE=E5=8D=8E=E5=B8=96=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20(#4474)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/pediy/topic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/pediy/topic.js b/lib/routes/pediy/topic.js index 01f39d9cd..4cef0e8d6 100644 --- a/lib/routes/pediy/topic.js +++ b/lib/routes/pediy/topic.js @@ -83,7 +83,7 @@ module.exports = async (ctx) => { item = $(item); const src = item.attr('src'); - if (!src.startsWith('https://') && !src.startsWith('http://')) { + if (typeof src !== 'undefined' && !src.startsWith('https://') && !src.startsWith('http://')) { item.attr('src', `https://bbs.pediy.com/${src}`); } item.attr('referrerpolicy', 'no-referrer'); From ddcd9e36e3d04e459c0d0b6f1599d4b3f0aa7350 Mon Sep 17 00:00:00 2001 From: cesaryuan <35998162+cesaryuan@users.noreply.github.com> Date: Sun, 19 Apr 2020 18:50:38 +0800 Subject: [PATCH 03/10] feat: add radar rule for Telegram (#4478) --- assets/radar-rules.js | 19 +++++++++++++++++++ docs/en/social-media.md | 2 +- docs/social-media.md | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/assets/radar-rules.js b/assets/radar-rules.js index b1f8e5e89..5d5c74ede 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -1659,4 +1659,23 @@ }, ], }, + 't.me': { + _name: 'Telegram', + '.': [ + { + title: '频道', + docs: 'https://docs.rsshub.app/social-media.html#telegram', + source: '/:username', + target: '/telegram/channel/:username', + script: "({isChannel:document.querySelector('.tgme_action_button_label')})", + verification: (params) => params.isChannel, + }, + { + title: '频道', + docs: 'https://docs.rsshub.app/social-media.html#telegram', + source: '/s/:username', + target: '/telegram/channel/:username', + }, + ], + }, }); diff --git a/docs/en/social-media.md b/docs/en/social-media.md index 8cc3fb34a..3d9d669d0 100644 --- a/docs/en/social-media.md +++ b/docs/en/social-media.md @@ -106,7 +106,7 @@ Only for self-hosted ### Channel - + ::: tip diff --git a/docs/social-media.md b/docs/social-media.md index 4e4fae86d..6700c0c06 100644 --- a/docs/social-media.md +++ b/docs/social-media.md @@ -376,7 +376,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性 ### 频道 - + ::: tip 提示 From 7fa3c7d362847f03bea9a29ab28895b7f81d005c Mon Sep 17 00:00:00 2001 From: mifang Date: Sun, 19 Apr 2020 18:52:53 +0800 Subject: [PATCH 04/10] =?UTF-8?q?feat:=20add=E8=B7=AF=E7=94=B1=20=E8=BF=BD?= =?UTF-8?q?=E6=96=B0=E7=95=AA=E6=97=A5=E5=89=A7=E7=AB=99=20(#4476)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/multimedia.md | 6 +++++ lib/router.js | 3 +++ lib/routes/zhuixinfan/list.js | 51 +++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 lib/routes/zhuixinfan/list.js diff --git a/docs/multimedia.md b/docs/multimedia.md index 71338e7e9..17836e760 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -470,6 +470,12 @@ pageClass: routes +## 追新番日剧站 + +### 更新列表 + + + ## 字幕库 ### 字幕列表 diff --git a/lib/router.js b/lib/router.js index a86a28a35..7dcc3edf7 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2539,4 +2539,7 @@ router.get('/girlimg/album/:tag?/:mode?', require('./routes/girlimg/album')); // etoland router.get('/etoland/:bo_table', require('./routes/etoland/board')); +// zhuixinfan +router.get('/zhuixinfan/list', require('./routes/zhuixinfan/list')); + module.exports = router; diff --git a/lib/routes/zhuixinfan/list.js b/lib/routes/zhuixinfan/list.js new file mode 100644 index 000000000..5cf50b727 --- /dev/null +++ b/lib/routes/zhuixinfan/list.js @@ -0,0 +1,51 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const moment = require('moment'); + +module.exports = async (ctx) => { + const response = await got({ + method: 'get', + url: `http://www.zhuixinfan.com/main.php`, + }); + + const data = response.data; + + const $ = cheerio.load(data); + const list = []; + Array.from($('.top-list-data:not(.top-list-data-all)')).forEach((table) => { + table = $(table); + const date = table.children('caption').first().text(); + + table + .find('tbody') + .children('tr') + .not((i) => i === 0) + .each((i, item) => { + item = $(item); + item.attr('date', date.substr(date.indexOf('(') + 1, 6)); + list.push(item); + }); + }); + + ctx.state.data = { + title: '追新番', + link: 'http://www.zhuixinfan.com/main.php', + language: 'zh-CN', + description: '追新番日剧站', + item: list.map((item) => { + const category = item.find('td.td2 a').first().text(); + const title = item.find('td.td2 a').last().text(); + const description = `资源大小:${item.find('td').eq(2).text()}`; + const link = item.find('td').eq(3).children('a').first().attr('href'); + const pubDate = moment(item.attr('date'), 'MM月DD号').toDate(); + + return { + title: title, + description: description, + category: category, + link: link, + pubDate: pubDate, + }; + }), + }; +}; From 7bd758fbeba2e7a4e70ae94d0ccf036328c6d882 Mon Sep 17 00:00:00 2001 From: Halcao Date: Sun, 19 Apr 2020 18:58:58 +0800 Subject: [PATCH 05/10] =?UTF-8?q?feat:=20add=20=E6=B8=85=E5=8D=8E=E5=A4=A7?= =?UTF-8?q?=E5=AD=A6=E6=8B=9B=E8=81=98=E4=BF=A1=E6=81=AF=20(#4400)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/university.md | 4 +++ lib/router.js | 1 + lib/routes/universities/thu/career.js | 40 +++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 lib/routes/universities/thu/career.js diff --git a/docs/university.md b/docs/university.md index 0dba433c1..2fdfc0bd8 100644 --- a/docs/university.md +++ b/docs/university.md @@ -986,6 +986,10 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet +### 清华大学招聘信息 + + + ## 山东大学 ### 软件学院通知 diff --git a/lib/router.js b/lib/router.js index 7dcc3edf7..1a597aa1a 100644 --- a/lib/router.js +++ b/lib/router.js @@ -591,6 +591,7 @@ router.get('/lit/xwzx/:name?', require('./routes/universities/lit/xwzx')); router.get('/lit/tw/:name?', require('./routes/universities/lit/tw')); // 清华大学 +router.get('/thu/career', require('./routes/universities/thu/career')); router.get('/thu/:type', require('./routes/universities/thu/index')); // 北京大学 diff --git a/lib/routes/universities/thu/career.js b/lib/routes/universities/thu/career.js new file mode 100644 index 000000000..3b3c6d06a --- /dev/null +++ b/lib/routes/universities/thu/career.js @@ -0,0 +1,40 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const resolve_url = require('url').resolve; + +const base_url = 'https://career.cic.tsinghua.edu.cn/'; + +module.exports = async (ctx) => { + const page = 1; + + const route = 'xsglxt/f/jyxt/anony/xxfb'; + const response = await got({ + method: 'post', + url: base_url + route, + body: `pgno=${page}`, + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-language': 'zh-CN,zh;q=0.9', + 'cache-control': 'max-age=0', + 'content-type': 'application/x-www-form-urlencoded', + 'proxy-connection': 'keep-alive', + 'upgrade-insecure-requests': '1', + }, + }); + + const $ = cheerio.load(response.data); + + const title = '招聘信息'; + ctx.state.data = { + title: '清华大学 - ' + title, + link: base_url, + description: '清华大学学生职业发展指导中心 - ' + title, + item: $('#ts_div .list li') + .map((_, elem) => ({ + link: resolve_url(base_url, $('a', elem).attr('ahref')), + title: $('a', elem).text(), + pubDate: new Date($('span', elem).text()).toUTCString(), + })) + .get(), + }; +}; From 68b4e172f52d9da060424f097434892aaec775c3 Mon Sep 17 00:00:00 2001 From: Zhi Yang Date: Sun, 19 Apr 2020 19:00:37 +0800 Subject: [PATCH 06/10] feat: Support itunes_category and itunes_explicit (#4483) --- lib/routes/ximalaya/album.js | 2 ++ lib/views/rss.art | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/routes/ximalaya/album.js b/lib/routes/ximalaya/album.js index 8d114f977..fb6a0944b 100644 --- a/lib/routes/ximalaya/album.js +++ b/lib/routes/ximalaya/album.js @@ -66,6 +66,8 @@ module.exports = async (ctx) => { enclosure_url: enclosure_url, enclosure_length: enclosure_length, enclosure_type: 'audio/x-m4a', + itunes_category: album_category, + itunes_explicit: 'clean', // 内容是否为限制级 }; return Promise.resolve(resultItem); }) diff --git a/lib/views/rss.art b/lib/views/rss.art index e59f4c5dc..c9d782e07 100644 --- a/lib/views/rss.art +++ b/lib/views/rss.art @@ -35,6 +35,8 @@ {{ if $value.itunes_item_image }}{{ /if }} {{ if $value.enclosure_url }}{{ /if }} {{ if itunes_author && $value.itunes_duration }}{{ $value.itunes_duration }} {{ /if }} + {{ if itunes_author && $value.itunes_category }}{{ $value.itunes_category }} {{ /if }} + {{ if itunes_author && $value.itunes_explicit }}{{ $value.itunes_explicit }} {{ /if }} {{ if $value.author }}{{ /if }} {{ if typeof $value.category === 'string' }} {{ $value.category }} From f536851d5753960dd3ef0eb2e2cef2b40e416505 Mon Sep 17 00:00:00 2001 From: maijver Date: Sun, 19 Apr 2020 19:01:33 +0800 Subject: [PATCH 07/10] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D36=E6=B0=AA?= =?UTF-8?q?=E5=BF=AB=E8=AE=AF,=20b=E7=AB=99UP=E4=B8=BB=E5=8A=A8=E6=80=81,?= =?UTF-8?q?=20segmentfault=E9=A2=91=E9=81=93,=20=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=96=B0=E9=97=BB=20(#4480)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/36kr/newsflashes.js | 24 ++++++-------- lib/routes/bilibili/dynamic.js | 12 +++++-- lib/routes/jiemian/list.js | 52 +++++++----------------------- lib/routes/segmentfault/channel.js | 2 +- 4 files changed, 31 insertions(+), 59 deletions(-) diff --git a/lib/routes/36kr/newsflashes.js b/lib/routes/36kr/newsflashes.js index a8cddcd67..ddbb8a2f2 100644 --- a/lib/routes/36kr/newsflashes.js +++ b/lib/routes/36kr/newsflashes.js @@ -3,24 +3,20 @@ const got = require('@/utils/got'); module.exports = async (ctx) => { const response = await got({ method: 'get', - url: `https://36kr.com/api/newsflash?per_page=30`, + url: `https://36kr.com/newsflashes`, headers: { - 'Content-Type': 'application/json; charset=utf-8', + Host: '36kr.com', + 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25', }, }); + const regexp = /