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 #2307 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
43 changed files
with
420 additions
and
38 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
'/awsblogs/:locale?': ['HankChow'], | ||
'/kindle/software-updates': ['NavePnow'], | ||
'/kindle/software-updates': ['EthanWng97'], | ||
}; |
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,5 +1,5 @@ | ||
module.exports = { | ||
'/new-arrivals/:country/:gender': ['NavePnow'], | ||
'/outlet/:country/:gender': ['NavePnow'], | ||
'/regear/new-arrivals': ['NavePnow'], | ||
'/new-arrivals/:country/:gender': ['EthanWng97'], | ||
'/outlet/:country/:gender': ['EthanWng97'], | ||
'/regear/new-arrivals': ['EthanWng97'], | ||
}; |
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,3 @@ | ||
module.exports = { | ||
'/new-releases': ['NavePnow'], | ||
'/new-releases': ['EthanWng97'], | ||
}; |
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,8 @@ | ||
const { processZxfkItems } = require('./util'); | ||
|
||
module.exports = async (ctx) => { | ||
const { site = 'beijing' } = ctx.params; | ||
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 3; | ||
|
||
ctx.state.data = await processZxfkItems(site, 'ywzx', limit); | ||
}; |
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,8 @@ | ||
const { processZxfkItems } = require('./util'); | ||
|
||
module.exports = async (ctx) => { | ||
const { site = 'beijing' } = ctx.params; | ||
const limit = ctx.query.limit ? parseInt(ctx.query.limit, 10) : 5; | ||
|
||
ctx.state.data = await processZxfkItems(site, 'tsjy', limit); | ||
}; |
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,25 @@ | ||
<table> | ||
<tbody> | ||
<tr> | ||
<th>留言人</th> | ||
<th>留言内容</th> | ||
<th>留言时间</th> | ||
</tr> | ||
{{ if message }} | ||
{{ set object = message }} | ||
<tr> | ||
<td>{{ object.author }}</td> | ||
<td>{{ object.content }}</td> | ||
<td>{{ object.date }}</td> | ||
</tr> | ||
{{ /if }} | ||
{{ if reply }} | ||
{{ set object = reply }} | ||
<tr style="color: #0069ae;"> | ||
<td>{{ object.author }}</td> | ||
<td>{{ object.content }}</td> | ||
<td>{{ object.date }}</td> | ||
</tr> | ||
{{ /if }} | ||
</tbody> | ||
</table> |
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,87 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const { art } = require('@/utils/render'); | ||
const path = require('path'); | ||
|
||
const rootUrl = 'https://www.safe.gov.cn'; | ||
|
||
const zxfkCategoryApis = { | ||
// 业务咨询 https://www.safe.gov.cn/<site>/ywzx/index.html | ||
ywzx: 'www/busines/businessQuery?siteid=', | ||
|
||
// 投诉建议 https://www.safe.gov.cn/<site>/tsjy/index.html | ||
tsjy: 'www/complaint/complaintQuery?siteid=', | ||
}; | ||
|
||
const processZxfkItems = async (site = 'beijing', category = 'ywzx', limit = '3') => { | ||
const apiUrl = new URL(`${zxfkCategoryApis[category]}${site}`, rootUrl).href; | ||
const currentUrl = new URL(`${site}/${category}/index.html`, rootUrl).href; | ||
|
||
const { data: response } = await got(apiUrl); | ||
|
||
const $ = cheerio.load(response); | ||
|
||
const items = $('#complaint') | ||
.slice(0, limit) | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
|
||
const spans = item.find('span[objid]'); | ||
|
||
const message = { | ||
author: spans.first().text().replace(/:$/, ''), | ||
content: spans.eq(1).text(), | ||
date: spans.eq(2).text(), | ||
}; | ||
|
||
const reply = { | ||
author: spans.eq(3).text().replace(/:$/, ''), | ||
content: spans.eq(4).text(), | ||
date: spans.eq(5).text(), | ||
}; | ||
|
||
return { | ||
title: `${message.author}: ${message.content}`, | ||
link: new URL(item.find('.title').prop('href'), rootUrl).href, | ||
description: art(path.join(__dirname, 'templates/message.art'), { | ||
message, | ||
reply, | ||
}), | ||
author: `${message.author}/${reply.author}`, | ||
guid: item.find('.id').text(), | ||
pubDate: parseDate(message.date), | ||
updated: parseDate(reply.date), | ||
}; | ||
}); | ||
|
||
const { data: currentResponse } = await got(currentUrl); | ||
|
||
const content = cheerio.load(currentResponse); | ||
|
||
const author = content('meta[name="ColumnName"]').prop('content'); | ||
const subtitle = content('meta[name="ColumnType"]').prop('content'); | ||
|
||
const imagePath = 'safe/templateresource/372b1dfdab204181b9b4f943a8e926a6'; | ||
const image = new URL(`${imagePath}/logo_06.png`, rootUrl).href; | ||
const icon = new URL(`${imagePath}/safe.ico`, rootUrl).href; | ||
|
||
return { | ||
item: items, | ||
title: `${author} - ${subtitle}`, | ||
link: currentUrl, | ||
description: content('meta[name="ColumnDescription"]').prop('content'), | ||
language: 'zh', | ||
image, | ||
icon, | ||
logo: icon, | ||
subtitle, | ||
author, | ||
allowEmpty: true, | ||
}; | ||
}; | ||
|
||
module.exports = { | ||
processZxfkItems, | ||
}; |
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,3 @@ | ||
module.exports = { | ||
'/download/:val/:id': ['NavePnow'], | ||
'/download/:val/:id': ['EthanWng97'], | ||
}; |
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,4 @@ | ||
module.exports = { | ||
'/html_clip/:user/:tag/:num?': ['BeautyyuYanli'], | ||
'/rss/:user/:tag': ['NavePnow'], | ||
'/rss/:user/:tag': ['EthanWng97'], | ||
}; |
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,6 +1,6 @@ | ||
module.exports = { | ||
'/articles': ['LogicJake'], | ||
'/dailyquestion/:lang': ['NavePnow'], | ||
'/dailyquestion/:lang': ['EthanWng97'], | ||
'/dailyquestion/solution/:lang': ['woaidouya123'], | ||
'/submission/:country/:user': ['NathanDai'], | ||
}; |
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,3 @@ | ||
module.exports = { | ||
'/latest-magazine/:query?': ['NavePnow'], | ||
'/latest-magazine/:query?': ['EthanWng97'], | ||
}; |
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 = { | ||
'/new': ['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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { art } = require('@/utils/render'); | ||
const { join } = require('path'); | ||
|
||
module.exports = async (ctx) => { | ||
const baseUrl = 'https://missav.com'; | ||
const { data: response } = await got(`${baseUrl}/dm397/new`); | ||
const $ = cheerio.load(response); | ||
|
||
const items = $('.grid .group') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
const title = item.find('.text-secondary'); | ||
const poster = new URL(item.find('img').data('src')); | ||
poster.searchParams.set('class', 'normal'); | ||
const video = item.find('video').data('src'); | ||
return { | ||
title: title.text().trim(), | ||
link: title.attr('href'), | ||
description: art(join(__dirname, 'templates/preview.art'), { | ||
poster: poster.href, | ||
video, | ||
type: video.split('.').pop(), | ||
}), | ||
}; | ||
}); | ||
|
||
ctx.state.data = { | ||
title: $('head title').text(), | ||
description: $('head meta[name="description"]').attr('content'), | ||
link: baseUrl, | ||
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,13 @@ | ||
module.exports = { | ||
'missav.com': { | ||
_name: 'MissAV.com', | ||
'.': [ | ||
{ | ||
title: '最近更新', | ||
docs: 'https://docs.rsshub.app/multimedia#missav-com', | ||
source: ['/dm397/new', '/new', '/'], | ||
target: '/missav/new', | ||
}, | ||
], | ||
}, | ||
}; |
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('/new', require('./new')); | ||
}; |
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 @@ | ||
<video controls preload="none" poster="{{ poster }}"> | ||
<source src="{{ video }}" type="{{ type }}"> | ||
</video> |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
'/patagonia/new-arrivals/:category': ['NavePnow'], | ||
'/patagonia/new-arrivals/:category': ['EthanWng97'], | ||
}; |
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,78 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const { art } = require('@/utils/render'); | ||
const { join } = require('path'); | ||
|
||
module.exports = async (ctx) => { | ||
const { bookName, bookId } = ctx.params; | ||
const baseUrl = 'https://www.routledge.com'; | ||
const pageUrl = `${baseUrl}/${bookName}/book-series/${bookId}`; | ||
const { data: response } = await got(pageUrl, { | ||
headers: { | ||
accept: 'text/html, */*; q=0.01', | ||
}, | ||
searchParams: { | ||
publishedFilter: 'alltitles', | ||
pd: 'published,forthcoming', | ||
pg: 1, | ||
pp: 12, | ||
so: 'pub', | ||
view: 'list', | ||
}, | ||
}); | ||
const $ = cheerio.load(response); | ||
|
||
const list = $('.row.book') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
const title = item.find('h3 a'); | ||
const description = item.find('p.description'); | ||
const meta = item.find('p.description').prev().text().split('\n'); | ||
return { | ||
title: title.text(), | ||
link: title.attr('href'), | ||
description: description.text(), | ||
pubDate: parseDate(meta.pop().trim(), 'MMMM DD, YYYY'), | ||
author: meta | ||
.map((i) => i.trim()) | ||
.filter((i) => i) | ||
.join(', '), | ||
}; | ||
}); | ||
|
||
const items = await Promise.all( | ||
list.map((item) => | ||
ctx.cache.tryGet(item.link, async () => { | ||
const { data } = await got(item.link); | ||
const $ = cheerio.load(data); | ||
const isbn = $('meta[property="books:isbn"]').attr('content'); | ||
const { data: image } = await got('https://productimages.routledge.com', { | ||
searchParams: { | ||
isbn, | ||
size: 'amazon', | ||
ext: 'jpg', | ||
}, | ||
}); | ||
|
||
const description = $('.sticky-div'); | ||
description.find('button.accordion-button').contents().unwrap(); | ||
description.find('.fa-shopping-cart').parent().parent().remove(); | ||
|
||
item.description = art(join(__dirname, 'templates/description.art'), { | ||
image, | ||
description: description.html(), | ||
}); | ||
return item; | ||
}) | ||
) | ||
); | ||
|
||
ctx.state.data = { | ||
title: $('head title').text(), | ||
description: $('head meta[name="description"]').attr('content'), | ||
link: pageUrl, | ||
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,3 @@ | ||
module.exports = { | ||
'/:bookName/book-series/:bookId': ['TonyRL'], | ||
}; |
Oops, something went wrong.