-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
206 additions
and
95 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 was deleted.
Oops, something went wrong.
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,3 @@ | ||
const { ProcessFeed } = require('./utils'); | ||
|
||
module.exports = async (ctx) => (ctx.state.data = await ProcessFeed('all', 0, ctx.params.order)); |
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,26 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
|
||
module.exports = async (ctx) => { | ||
const link = 'https://www.hpoi.net/bannerItem/list?categoryId=0&bannerItemType=0&subType=0&page=1'; | ||
const response = await got({ | ||
method: 'get', | ||
url: link, | ||
}); | ||
const $ = cheerio.load(response.data); | ||
ctx.state.data = { | ||
title: `Hpoi 手办维基 - 热门推荐`, | ||
link, | ||
item: $('#content .item') | ||
.map((_index, _item) => { | ||
_item = $(_item); | ||
return { | ||
title: _item.find('.title').text(), | ||
link: 'https://www.hpoi.net/' + _item.find('a').attr('href'), | ||
description: `<img src="${_item.find('img').attr('src')}">`, | ||
pubDate: new Date(_item.find('.time').text().replace('发布时间:', '')).toUTCString(), | ||
}; | ||
}) | ||
.get(), | ||
}; | ||
}; |
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 @@ | ||
const { ProcessFeed } = require('./utils'); | ||
|
||
module.exports = async (ctx) => (ctx.state.data = await ProcessFeed('character', ctx.params.id, ctx.params.order)); |
File renamed without changes.
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 @@ | ||
module.exports = { | ||
'/info/:type?': ['sanmmm DIYgod'], | ||
'/items/all/:order?': ['DIYgod'], | ||
'/items/character/:id/:order?': ['DIYgod'], | ||
'/items/work/:id/:order?': ['DIYgod'], | ||
'/user/:user_id/:caty': ['DIYgod', 'luyuhuang'], | ||
'/bannerItem': ['DIYgod'], | ||
}; |
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,37 @@ | ||
module.exports = { | ||
'hpoi.net': { | ||
_name: 'Hpoi手办维基', | ||
www: [ | ||
{ | ||
title: '情报', | ||
docs: 'https://docs.rsshub.app/routes/anime#hpoi-shou-ban-wei-ji', | ||
source: ['/user/home'], | ||
target: '/hpoi/info/all', | ||
}, | ||
{ | ||
title: '所有周边', | ||
docs: 'https://docs.rsshub.app/routes/anime#hpoi-shou-ban-wei-ji', | ||
source: ['/hobby/all'], | ||
target: '/hpoi/items/all', | ||
}, | ||
{ | ||
title: '角色周边', | ||
docs: 'https://docs.rsshub.app/routes/anime#hpoi-shou-ban-wei-ji', | ||
}, | ||
{ | ||
title: '作品周边', | ||
docs: 'https://docs.rsshub.app/routes/anime#hpoi-shou-ban-wei-ji', | ||
}, | ||
{ | ||
title: '用户动态', | ||
docs: 'https://docs.rsshub.app/routes/anime#hpoi-shou-ban-wei-ji', | ||
}, | ||
{ | ||
title: '热门推荐', | ||
docs: 'https://docs.rsshub.app/routes/anime#hpoi-shou-ban-wei-ji', | ||
source: ['/bannerItem/list'], | ||
target: '/hpoi/bannerItem', | ||
}, | ||
], | ||
}, | ||
}; |
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 @@ | ||
module.exports = function (router) { | ||
router.get('/info/:type?', require('./info')); | ||
router.get('/items/all/:order?', require('./all')); | ||
router.get('/items/character/:id/:order?', require('./character')); | ||
router.get('/items/work/:id/:order?', require('./work')); | ||
router.get('/user/:user_id/:caty', require('./user')); | ||
router.get('/bannerItem', require('./bannerItem')); | ||
}; |
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,43 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
|
||
const root_url = 'https://www.hpoi.net'; | ||
|
||
const titleMap = { | ||
want: '想买', | ||
preorder: '预定', | ||
buy: '已入', | ||
care: '关注', | ||
resell: '有过', | ||
}; | ||
|
||
module.exports = async (ctx) => { | ||
const { user_id, caty } = ctx.params; | ||
|
||
const url = `${root_url}/user/${user_id}/hobby?order=actionDate&view=2&favState=${caty}`; | ||
const response = await got({ | ||
method: 'get', | ||
url, | ||
}); | ||
|
||
const $ = cheerio.load(response.data); | ||
const list = $('.collect-hobby-list-small') | ||
.map((_, item) => { | ||
item = $(item); | ||
return { | ||
title: titleMap[caty] + ': ' + item.find('.name').text(), | ||
link: 'https://www.hpoi.net/' + item.find('.name').attr('href'), | ||
description: `<img src="${item.find('img').attr('src').replace('/s/', '/n/')}"><br>${item.find('.pay').text()}<br>${item.find('.score').text()}`, | ||
}; | ||
}) | ||
.get(); | ||
|
||
const title = $('.hpoi-collect-head .info p').eq(0).text() + '的手办 - ' + titleMap[caty]; | ||
|
||
ctx.state.data = { | ||
title, | ||
link: url, | ||
item: list, | ||
allowEmpty: true, | ||
}; | ||
}; |
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,49 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
|
||
const host = 'https://www.hpoi.net'; | ||
|
||
const MAPs = { | ||
character: { | ||
url: `${host}/hobby/all?order={order}&r18=-1&charactar={id}`, | ||
title: '角色周边', | ||
}, | ||
work: { | ||
url: `${host}/hobby/all?order={order}&r18=-1&works={id}`, | ||
title: '作品周边', | ||
}, | ||
all: { | ||
url: `${host}/hobby/all?order={order}&r18=-1`, | ||
title: '全部周边', | ||
}, | ||
}; | ||
|
||
const ProcessFeed = async (type, id, order) => { | ||
const link = MAPs[type].url.replace(/{id}/, id).replace(/{order}/, order || 'add'); | ||
const response = await got({ | ||
method: 'get', | ||
url: link, | ||
headers: { | ||
Referer: host, | ||
}, | ||
}); | ||
const $ = cheerio.load(response.data); | ||
return { | ||
title: `Hpoi 手办维基 - ${MAPs[type].title}${id ? ` ${id}` : ''}`, | ||
link, | ||
item: $('.hpoi-glyphicons-list li') | ||
.map((_index, _item) => { | ||
_item = $(_item); | ||
return { | ||
title: _item.find('.hpoi-detail-grid-title a').text(), | ||
link: host + '/' + _item.find('a').attr('href'), | ||
description: `<img src="${_item.find('img').attr('src').replace('/s/', '/n/')}">${_item.find('.hpoi-detail-grid-info').html().replace(/span>/g, 'p>')}`, | ||
}; | ||
}) | ||
.get(), | ||
}; | ||
}; | ||
|
||
module.exports = { | ||
ProcessFeed, | ||
}; |
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 @@ | ||
const { ProcessFeed } = require('./utils'); | ||
|
||
module.exports = async (ctx) => (ctx.state.data = await ProcessFeed('work', ctx.params.id, ctx.params.order)); |
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