From 347d7151cab75618608685c5618d4c64463b1644 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Wed, 6 Mar 2019 16:53:21 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=AF=B9=E7=94=B5=E5=BD=B1=E5=A4=A9?= =?UTF-8?q?=E5=A0=82=E5=A2=9E=E5=8A=A0=E5=85=A8=E6=96=87=E6=8A=93=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit let list = $('.co_content8 table tr').get(); list.splice(0, 1); 原因如下: 页面内含有两个 .co_content8 table 仅第一个 table内 第一个 tr 元素是广告 const list = $('.co_content8 table tr:not(:first-child)').get(); 会丢失第二个table的第一个tr元素 --- lib/routes/dytt/index.js | 59 +++++++++++++++++++++++++++++----------- 1 file changed, 43 insertions(+), 16 deletions(-) diff --git a/lib/routes/dytt/index.js b/lib/routes/dytt/index.js index c89bfd63f42cfb..5f8d883b494a01 100644 --- a/lib/routes/dytt/index.js +++ b/lib/routes/dytt/index.js @@ -1,6 +1,24 @@ const axios = require('../../utils/axios'); const cheerio = require('cheerio'); const iconv = require('iconv-lite'); + +async function load(link, ctx) { + const cache = await ctx.cache.get(link); + if (cache) { + return cache; + } + const response = await axios.get(link, { + responseType: 'arraybuffer', + }); + response.data = iconv.decode(response.data, 'gb2312'); + + const $ = cheerio.load(response.data); + + const description = $('div#Zoom').html(); + await ctx.cache.set(link, description, 24 * 60 * 60); + return description; +} + module.exports = async (ctx) => { const response = await axios.get('http://www.dytt8.net', { responseType: 'arraybuffer', @@ -8,26 +26,35 @@ module.exports = async (ctx) => { response.data = iconv.decode(response.data, 'gb2312'); const $ = cheerio.load(response.data); - const list = $('.co_content8 table tr').get(); + let list = $('.co_content8 table tr').get(); + // 页面含有2个.co_content8 table + // 仅第一个table内第一个tr元素是广告连接 + // 去除该广告连接 + list.splice(0, 1); + // const list = $('.co_content8 table tr:not(:first-child)').get(); + const process = await Promise.all( + list.map(async (item) => { + const link = $(item).find('a:nth-of-type(2)'); + const itemUrl = 'http://www.dytt8.net' + link.attr('href'); + const other = await load(itemUrl, ctx); + return { + title: link.text(), + description: other, + pubDate: new Date( + $(item) + .find('font') + .text() + ).toUTCString(), + link: itemUrl, + }; + }) + ); + const data = { title: '电影天堂', link: 'http://www.dytt8.net', description: '电影天堂RSS', - item: list - .map((item) => { - const link = $(item).find('a:nth-of-type(2)'); - return { - title: link.text(), - description: link.text(), - pubDate: new Date( - $(item) - .find('font') - .text() - ).toUTCString(), - link: 'http://www.dytt8.net' + link.attr('href'), - }; - }) - .slice(1), + item: process }; ctx.state.data = data; From 4abd094028f6d700f1c186f0deb604151a01a638 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Wed, 6 Mar 2019 17:06:59 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9CI=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit let list -> const list --- lib/routes/dytt/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/dytt/index.js b/lib/routes/dytt/index.js index 5f8d883b494a01..28c193184c117a 100644 --- a/lib/routes/dytt/index.js +++ b/lib/routes/dytt/index.js @@ -26,7 +26,7 @@ module.exports = async (ctx) => { response.data = iconv.decode(response.data, 'gb2312'); const $ = cheerio.load(response.data); - let list = $('.co_content8 table tr').get(); + const list = $('.co_content8 table tr').get(); // 页面含有2个.co_content8 table // 仅第一个table内第一个tr元素是广告连接 // 去除该广告连接 From 3c9101b6c452db07b3c9b787b4412e96f31ac272 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Wed, 6 Mar 2019 17:16:32 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 执行npm run format --- lib/routes/dytt/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/dytt/index.js b/lib/routes/dytt/index.js index 28c193184c117a..90b1db94462e83 100644 --- a/lib/routes/dytt/index.js +++ b/lib/routes/dytt/index.js @@ -54,7 +54,7 @@ module.exports = async (ctx) => { title: '电影天堂', link: 'http://www.dytt8.net', description: '电影天堂RSS', - item: process + item: process, }; ctx.state.data = data; From bacf6dadab6fd79f25cdef3c011e7b84ae7d4a55 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Mon, 25 Mar 2019 15:02:27 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=20=E7=BB=88?= =?UTF-8?q?=E7=82=B9=E5=88=86=E4=BA=AB=20bbs.zdfx.net=20=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E6=B1=89=E5=8C=96=E7=9A=84=E8=BF=BD=E8=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/anime.md | 4 ++++ lib/router.js | 3 +++ lib/routes/galgame/zdfx.js | 30 ++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 lib/routes/galgame/zdfx.js diff --git a/docs/anime.md b/docs/anime.md index 6781261a19cb14..4deca406c62671 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -26,6 +26,10 @@ +## 终点分享 + + + ## 看漫画 diff --git a/lib/router.js b/lib/router.js index 43925dace8c1da..0c47bdda07a70a 100755 --- a/lib/router.js +++ b/lib/router.js @@ -572,6 +572,9 @@ router.get('/gitlab/explore/:type', require('./routes/gitlab/explore')); router.get('/mygalgame', require('./routes/galgame/mmgal')); router.get('/mmgal', require('./routes/galgame/mmgal')); +// 终点分享 +router.get('/zdfx', require('./routes/galgame/zdfx')); + // 大连工业大学 router.get('/dpu/jiaowu/news/:type?', require('./routes/universities/dpu/jiaowu/news')); router.get('/dpu/wlfw/news/:type?', require('./routes/universities/dpu/wlfw/news')); diff --git a/lib/routes/galgame/zdfx.js b/lib/routes/galgame/zdfx.js new file mode 100644 index 00000000000000..d1989c40097069 --- /dev/null +++ b/lib/routes/galgame/zdfx.js @@ -0,0 +1,30 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); +const host = 'https://bbs.zdfx.net/'; + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: host, + }); + const $ = cheerio.load(response.data); + const list = $('.slideother a'); + + const process = list.map((index, item) => { + const a = $(item); + const img_tag = '.slideshow a:nth-child(' + (index + 1).toString() + ')'; + + return { + title: a.text(), + description: $(img_tag).html(), + link: host + a.attr('href'), + }; + }); + + ctx.state.data = { + title: '终点分享', + link: host, + description: '终点分享最新汉化通知', + item: process.get(), + }; +}; From a939589e02d5ae62c689de41b6768396a169b9c9 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Wed, 27 Mar 2019 21:19:41 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E4=BA=BA=E4=BA=BA?= =?UTF-8?q?=E5=BD=B1=E8=A7=86=20=E6=9C=80=E6=96=B0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=89=A7=E9=9B=86RSS?= 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/yyets/latest.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 lib/routes/yyets/latest.js diff --git a/docs/multimedia.md b/docs/multimedia.md index fd5d7661c15aca..f8495b61aebca5 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -183,3 +183,9 @@ | 剧情片 | 战争片 | 国产剧 | 港台剧 | 日韩剧 | 欧美剧 | + +## 人人影视 + + + +> 官方自带RSS, 该RSS只是为了配合**filter**等参数过滤,进行更新提醒。追剧推荐使用官方客户端。 diff --git a/lib/router.js b/lib/router.js index 0c47bdda07a70a..3fc2538a9e2345 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1213,4 +1213,7 @@ router.get('/zju/career/:type', require('./routes/universities/zju/career')); router.get('/infoq/recommend', require('./routes/infoq/recommend')); router.get('/infoq/topic/:id', require('./routes/infoq/topic')); +// 人人影视 +router.get('/yyets/latest', require('./routes/yyets/latest')); + module.exports = router; diff --git a/lib/routes/yyets/latest.js b/lib/routes/yyets/latest.js new file mode 100644 index 00000000000000..6a53373e5a609f --- /dev/null +++ b/lib/routes/yyets/latest.js @@ -0,0 +1,29 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); +const host = 'http://diaodiaode.me/rss/feed'; + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: host, + }); + const $ = cheerio.load(response.data); + const list = $('item'); + + const process = list.map((index, item) => { + return { + title: $(item).find('title').text(), + description: $(item).find('description').text(), + guid: $(item).find('guid').text(), + link: $(item).find('link').text(), + pubDate: $(item).find('pubDate').text(), + }; + }); + + ctx.state.data = { + title: '人人影视 - 更新剧集', + link: host, + description: '人人影视 - 更新剧集', + item: process.get(), + }; +}; From 82e95051ee6c97d5733ab70f23b740bc38313ca0 Mon Sep 17 00:00:00 2001 From: junfengP <840282629@qq.com> Date: Wed, 27 Mar 2019 21:40:54 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E8=B0=83=E7=94=A8npm=20run=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/multimedia.md | 2 +- lib/routes/yyets/latest.js | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/multimedia.md b/docs/multimedia.md index f8495b61aebca5..ee5afd8df1801c 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -188,4 +188,4 @@ -> 官方自带RSS, 该RSS只是为了配合**filter**等参数过滤,进行更新提醒。追剧推荐使用官方客户端。 +> 官方自带 RSS, 该 RSS 只是为了配合**filter**等参数过滤,进行更新提醒。追剧推荐使用官方客户端。 diff --git a/lib/routes/yyets/latest.js b/lib/routes/yyets/latest.js index 6a53373e5a609f..9931996239cebd 100644 --- a/lib/routes/yyets/latest.js +++ b/lib/routes/yyets/latest.js @@ -10,15 +10,23 @@ module.exports = async (ctx) => { const $ = cheerio.load(response.data); const list = $('item'); - const process = list.map((index, item) => { - return { - title: $(item).find('title').text(), - description: $(item).find('description').text(), - guid: $(item).find('guid').text(), - link: $(item).find('link').text(), - pubDate: $(item).find('pubDate').text(), - }; - }); + const process = list.map((index, item) => ({ + title: $(item) + .find('title') + .text(), + description: $(item) + .find('description') + .text(), + guid: $(item) + .find('guid') + .text(), + link: $(item) + .find('link') + .text(), + pubDate: $(item) + .find('pubDate') + .text(), + })); ctx.state.data = { title: '人人影视 - 更新剧集', From 83b4aba7e3c97b7633125c4bc04f0e3927d98ee5 Mon Sep 17 00:00:00 2001 From: junfeng_lab205 Date: Sat, 30 Mar 2019 13:53:45 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20=E4=BA=BA=E4=BA=BA?= =?UTF-8?q?=E5=BD=B1=E8=A7=86=E8=B7=AF=E7=94=B1=20=E4=BB=A5=E5=8F=8A=20?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/multimedia.md | 5 ----- lib/routes/yyets/latest.js | 37 ------------------------------------- 2 files changed, 42 deletions(-) delete mode 100644 lib/routes/yyets/latest.js diff --git a/docs/multimedia.md b/docs/multimedia.md index ee5afd8df1801c..6fbc73ea2b800d 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -184,8 +184,3 @@ -## 人人影视 - - - -> 官方自带 RSS, 该 RSS 只是为了配合**filter**等参数过滤,进行更新提醒。追剧推荐使用官方客户端。 diff --git a/lib/routes/yyets/latest.js b/lib/routes/yyets/latest.js deleted file mode 100644 index 9931996239cebd..00000000000000 --- a/lib/routes/yyets/latest.js +++ /dev/null @@ -1,37 +0,0 @@ -const axios = require('../../utils/axios'); -const cheerio = require('cheerio'); -const host = 'http://diaodiaode.me/rss/feed'; - -module.exports = async (ctx) => { - const response = await axios({ - method: 'get', - url: host, - }); - const $ = cheerio.load(response.data); - const list = $('item'); - - const process = list.map((index, item) => ({ - title: $(item) - .find('title') - .text(), - description: $(item) - .find('description') - .text(), - guid: $(item) - .find('guid') - .text(), - link: $(item) - .find('link') - .text(), - pubDate: $(item) - .find('pubDate') - .text(), - })); - - ctx.state.data = { - title: '人人影视 - 更新剧集', - link: host, - description: '人人影视 - 更新剧集', - item: process.get(), - }; -}; From 4616065df5ef9d27d3208731fbaa860c2f2276ec Mon Sep 17 00:00:00 2001 From: junfeng Date: Fri, 19 Apr 2019 22:50:24 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A9=AC=E8=89=AF?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/multimedia.md | 1 - docs/other.md | 4 ++++ lib/router.js | 3 +++ lib/routes/mlhang/latest.js | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 lib/routes/mlhang/latest.js diff --git a/docs/multimedia.md b/docs/multimedia.md index d8fb5c5d6fafb6..413a414b33a0c2 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -189,4 +189,3 @@ | 剧情片 | 战争片 | 国产剧 | 港台剧 | 日韩剧 | 欧美剧 | - diff --git a/docs/other.md b/docs/other.md index dabe7d75ece594..9d601527dd6752 100644 --- a/docs/other.md +++ b/docs/other.md @@ -487,3 +487,7 @@ type 为 all 时,category 参数不支持 cost 和 free ### 电商在线 + +### 马良行 + + diff --git a/lib/router.js b/lib/router.js index b0ea54011e363a..49f36d25945595 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1263,4 +1263,7 @@ router.get('/bupt/yz/:type', require('./routes/universities/bupt/yz')); // VOCUS 方格子 router.get('/vocus/publication/:id', require('./routes/vocus/publication')); +// 马良行 +router.get('/mlhang', require('./routes/mlhang/latest')); + module.exports = router; diff --git a/lib/routes/mlhang/latest.js b/lib/routes/mlhang/latest.js new file mode 100644 index 00000000000000..00daa552a1437f --- /dev/null +++ b/lib/routes/mlhang/latest.js @@ -0,0 +1,23 @@ +const axios = require('../../utils/axios'); +const api_url = 'https://www.mlhang.com/search/contents?start=0&count=10'; +const host = 'https://www.mlhang.com'; + +module.exports = async (ctx) => { + const response = await axios({ + method: 'get', + url: api_url, + }); + const data = response.data.data.docs; + + ctx.state.data = { + title: '马良行|建筑行业知识分享平台', + link: host, + description: '马良行文章更新提醒', + item: data.map((item) => ({ + title: item['title.0.name'], + description: item.detail, + pubDate: new Date(item.updateTime * 1), + link: host + item.resurl, + })), + }; +}; From 7e684cb31649b7e3495d0731d068b25416222b7e Mon Sep 17 00:00:00 2001 From: junfeng Date: Thu, 25 Apr 2019 11:44:04 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=BF=A7=E9=83=81?= =?UTF-8?q?=E7=9A=84=E8=8A=B1=E7=81=AB=20=3F=20(say=E8=8A=B1=E7=81=AB?= =?UTF-8?q?=E6=B1=89=E5=8C=96=E5=AD=90=E6=9D=BF=E5=9D=97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/anime.md | 4 ++++ lib/router.js | 3 +++ lib/routes/galgame/sayhuahuo.js | 41 +++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 lib/routes/galgame/sayhuahuo.js diff --git a/docs/anime.md b/docs/anime.md index 4deca406c62671..faaf8a95cd553e 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -26,6 +26,10 @@ +## say 花火 + + + ## 终点分享 diff --git a/lib/router.js b/lib/router.js index 7d0b45f32863ce..c196f458da3ecd 100755 --- a/lib/router.js +++ b/lib/router.js @@ -574,6 +574,9 @@ router.get('/gitlab/explore/:type', require('./routes/gitlab/explore')); router.get('/mygalgame', require('./routes/galgame/mmgal')); router.get('/mmgal', require('./routes/galgame/mmgal')); +// say花火 +router.get('/sayhuahuo', require('./routes/galgame/sayhuahuo')); + // 终点分享 router.get('/zdfx', require('./routes/galgame/zdfx')); diff --git a/lib/routes/galgame/sayhuahuo.js b/lib/routes/galgame/sayhuahuo.js new file mode 100644 index 00000000000000..f17a2919f31cce --- /dev/null +++ b/lib/routes/galgame/sayhuahuo.js @@ -0,0 +1,41 @@ +const axios = require('../../utils/axios'); +const cheerio = require('cheerio'); + +module.exports = async (ctx) => { + const res = await axios({ + method: 'get', + url: 'https://index.say-huahuo.com/', + header: { + Referer: 'https://index.say-huahuo.com/', + }, + }); + + const data = res.data; + + const $ = cheerio.load(data); + const list = $('#article-list').find('.article'); + + ctx.state.data = { + title: $('title').text(), + link: 'https://index.say-huahuo.com/', + description: '花火学园', + item: + list && + list + .map((index, item) => { + item = $(item); + const time = `${item.find('.month').text()}${item.find('.day').text()}日`; + const date = new Date(); + // 1-9月 实际抓取为:1 月 + const math = /(\d+)\s?月(\d+)日/.exec(time); + const pubdate = new Date(date.getFullYear(), parseInt(math[1]) - 1, math[2]); + return { + title: item.find('h1').text(), + description: `${item.find('.info p').text()}`, + pubDate: pubdate > date ? new Date(date.getFullYear() - 1, parseInt(math[1]) - 1, math[2]).toUTCString() : pubdate.toUTCString(), + link: item.find('h1 a').attr('href'), + }; + }) + .get(), + }; +}; From bd3aa3d60a9d91d8cbdc1d483ad76c4935f8db32 Mon Sep 17 00:00:00 2001 From: junfeng Date: Thu, 25 Apr 2019 11:58:33 +0800 Subject: [PATCH 10/10] yarn run format --- lib/router.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/router.js b/lib/router.js index 889eb13efc2ac5..3dd320729b633c 100755 --- a/lib/router.js +++ b/lib/router.js @@ -1281,7 +1281,6 @@ router.get('/1point3acres/user/:id/posts', require('./routes/1point3acres/posts' // 广东海洋大学 router.get('/gdoujwc', require('./routes/universities/gdou/jwc/jwtz')); - // 中国高清网 router.get('/gaoqingla/:tag?', require('./routes/gaoqingla/latest'));