diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 0cef7ad4dc70ca..313385b8d940da 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -51,9 +51,7 @@ { title: '经济信息工程学院 - 学院新闻', docs: 'https://docs.rsshub.app/routes/university#xi-nan-cai-jing-da-xue', source: '/index/xyxw.htm', target: '/swufe/seie/xyxw' }, ], }, - 'ishuhui.com': { _name: '鼠绘漫画', www: [{ title: '鼠绘漫画', docs: 'https://docs.rsshub.app/routes/anime#shu-hui-man-hua', source: '/comics/anime/:id', target: '/shuhui/comics/:id' }] }, 'www.chicagotribune.com': { _name: 'Chicago Tribune', www: [{ title: 'Chicago Tribune', docs: 'https://docs.rsshub.app/routes/traditional_media#chicago-tribune', source: '/' }] }, - 'haimaoba.com': { _name: '海猫吧', www: [{ title: '漫画更新', docs: 'https://docs.rsshub.app/routes/anime#hai-mao-ba', source: '/catalog/:id', target: '/haimaoba/:id' }] }, 'pgyer.com': { _name: '蒲公英应用分发', www: [{ title: 'app更新', docs: 'https://docs.rsshub.app/routes/program-update#pu-gong-ying-ying-yong-fen-fa', source: '/:app', target: '/pgyer/:app' }] }, 'wineyun.com': { _name: '酒云网', www: [{ title: '最新商品', docs: 'https://docs.rsshub.app/routes/other#jiu-yun-wang', source: ['/:category'], target: '/wineyun/:category' }] }, 'playstation.com': { @@ -74,14 +72,6 @@ { title: '最新消息', docs: 'https://docs.rsshub.app/routes/game#guai-wu-lie-ren-shi-jie', source: ['', '/*tpath'], target: '/mhw/news' }, ], }, - 'vgtime.com': { - _name: '游戏时光', - www: [ - { title: '新闻', docs: 'https://docs.rsshub.app/routes/game#you-xi-shi-guang', source: '/topic/index.', target: '/vgtime/news' }, - { title: '游戏发售表', docs: 'https://docs.rsshub.app/routes/game#you-xi-shi-guang', source: '/game/release.', target: '/vgtime/release' }, - { title: '关键词资讯', docs: 'https://docs.rsshub.app/routes/game#you-xi-shi-guang', source: '/search/list.', target: (params, url) => `/vgtime/keyword/${new URL(url).searchParams.get('keyword')}` }, - ], - }, 'bing.com': { _name: 'Bing', www: [{ title: '每日壁纸', docs: 'https://docs.rsshub.app/routes/picture#bing-bi-zhi', source: '', target: '/bing' }] }, 'wegene.com': { _name: 'WeGene', @@ -90,7 +80,6 @@ { title: '栏目', docs: 'https://docs.rsshub.app/routes/other#wegene', source: '/crowdsourcing', target: '/wegene/column/all/all' }, ], }, - '3ycy.com': { _name: '三界异次元', www: [{ title: '最近更新', docs: 'https://docs.rsshub.app/routes/anime#san-jie-yi-ci-yuan', source: '/', target: '/3ycy/home' }] }, 'emi-nitta.net': { _name: 'Emi Nitta', '.': [ diff --git a/lib/radar-rules.js b/lib/radar-rules.js index 61ccec19be4030..63b9c68c717380 100644 --- a/lib/radar-rules.js +++ b/lib/radar-rules.js @@ -56,17 +56,6 @@ module.exports = { }, ], }, - 'ishuhui.com': { - _name: '鼠绘漫画', - www: [ - { - title: '鼠绘漫画', - docs: 'https://docs.rsshub.app/routes/anime#shu-hui-man-hua', - source: '/comics/anime/:id', - target: '/shuhui/comics/:id', - }, - ], - }, 'www.chicagotribune.com': { _name: 'Chicago Tribune', www: [ @@ -77,17 +66,6 @@ module.exports = { }, ], }, - 'haimaoba.com': { - _name: '海猫吧', - www: [ - { - title: '漫画更新', - docs: 'https://docs.rsshub.app/routes/anime#hai-mao-ba', - source: '/catalog/:id', - target: '/haimaoba/:id', - }, - ], - }, 'pgyer.com': { _name: '蒲公英应用分发', www: [ @@ -154,29 +132,6 @@ module.exports = { }, ], }, - 'vgtime.com': { - _name: '游戏时光', - www: [ - { - title: '新闻', - docs: 'https://docs.rsshub.app/routes/game#you-xi-shi-guang', - source: '/topic/index.jhtml', - target: '/vgtime/news', - }, - { - title: '游戏发售表', - docs: 'https://docs.rsshub.app/routes/game#you-xi-shi-guang', - source: '/game/release.jhtml', - target: '/vgtime/release', - }, - { - title: '关键词资讯', - docs: 'https://docs.rsshub.app/routes/game#you-xi-shi-guang', - source: '/search/list.jhtml', - target: (params, url) => `/vgtime/keyword/${new URL(url).searchParams.get('keyword')}`, - }, - ], - }, 'bing.com': { _name: 'Bing', www: [ @@ -205,17 +160,6 @@ module.exports = { }, ], }, - '3ycy.com': { - _name: '三界异次元', - www: [ - { - title: '最近更新', - docs: 'https://docs.rsshub.app/routes/anime#san-jie-yi-ci-yuan', - source: '/', - target: '/3ycy/home', - }, - ], - }, 'emi-nitta.net': { _name: 'Emi Nitta', diff --git a/lib/router.js b/lib/router.js index 0eb14c176f0854..23c4de43cf356e 100644 --- a/lib/router.js +++ b/lib/router.js @@ -16,9 +16,6 @@ const lazyloadRouteHandler = (routeHandlerPath) => (ctx) => { // Deprecated: DO NOT ADD ANY NEW ROUTES HERE -// 1draw -router.get('/1draw', lazyloadRouteHandler('./routes/1draw/index')); - // Benedict Evans router.get('/benedictevans', lazyloadRouteHandler('./routes/benedictevans/recent.js')); @@ -197,17 +194,6 @@ router.get('/gitlab/explore/:type/:host?', lazyloadRouteHandler('./routes/gitlab router.get('/gitlab/release/:namespace/:project/:host?', lazyloadRouteHandler('./routes/gitlab/release')); router.get('/gitlab/tag/:namespace/:project/:host?', lazyloadRouteHandler('./routes/gitlab/tag')); -// 忧郁的loli -router.get('/mygalgame', lazyloadRouteHandler('./routes/galgame/hhgal')); // 废弃 -router.get('/mmgal', lazyloadRouteHandler('./routes/galgame/hhgal')); // 废弃 -router.get('/hhgal', lazyloadRouteHandler('./routes/galgame/hhgal')); - -// say花火 -router.get('/sayhuahuo', lazyloadRouteHandler('./routes/galgame/sayhuahuo')); - -// 终点分享 -router.get('/zdfx', lazyloadRouteHandler('./routes/galgame/zdfx')); - // 北京交通大学 router.get('/bjtu/gs/:type', lazyloadRouteHandler('./routes/universities/bjtu/gs')); @@ -593,9 +579,6 @@ router.get('/xiaoheihe/discount/:platform?', lazyloadRouteHandler('./routes/xiao // 惠誉评级 router.get('/fitchratings/site/:type', lazyloadRouteHandler('./routes/fitchratings/site')); -// Animen -router.get('/animen/news/:type', lazyloadRouteHandler('./routes/animen/news')); - // ebb router.get('/ebb', lazyloadRouteHandler('./routes/ebb')); @@ -651,14 +634,6 @@ router.get('/blogs/wordpress/:domain/:https?', lazyloadRouteHandler('./routes/bl // 今日热榜 migrated to v2 // router.get('/tophub/:id', lazyloadRouteHandler('./routes/tophub')); -// 游戏时光 -router.get('/vgtime/news', lazyloadRouteHandler('./routes/vgtime/news.js')); -router.get('/vgtime/release', lazyloadRouteHandler('./routes/vgtime/release')); -router.get('/vgtime/keyword/:keyword', lazyloadRouteHandler('./routes/vgtime/keyword')); - -// anitama -router.get('/anitama/:channel?', lazyloadRouteHandler('./routes/anitama/channel')); - // 親子王國 router.get('/babykingdom/:id/:order?', lazyloadRouteHandler('./routes/babykingdom')); @@ -749,18 +724,12 @@ router.get('/kpmg/insights', lazyloadRouteHandler('./routes/kpmg/insights')); router.get('/gradcafe/result/:type', lazyloadRouteHandler('./routes/gradcafe/result')); router.get('/gradcafe/result', lazyloadRouteHandler('./routes/gradcafe/result')); -// 鼠绘漫画 -router.get('/shuhui/comics/:id', lazyloadRouteHandler('./routes/shuhui/comics')); - // 朝日新闻 router.get('/asahi/:genre?/:category?', lazyloadRouteHandler('./routes/asahi/index')); // SoundCloud router.get('/soundcloud/tracks/:user', lazyloadRouteHandler('./routes/soundcloud/tracks')); -// dilidili -router.get('/dilidili/fanju/:id', lazyloadRouteHandler('./routes/dilidili/fanju')); - // 且听风吟福利 router.get('/qtfyfl/:category', lazyloadRouteHandler('./routes/qtfyfl/category')); @@ -775,11 +744,6 @@ router.get('/paidai/news', lazyloadRouteHandler('./routes/paidai/news')); // 漫画db router.get('/manhuadb/comics/:id', lazyloadRouteHandler('./routes/manhuadb/comics')); -// Hpoi 手办维基 -router.get('/hpoi/info/:type?', lazyloadRouteHandler('./routes/hpoi/info')); -router.get('/hpoi/:category/:words', lazyloadRouteHandler('./routes/hpoi')); -router.get('/hpoi/user/:user_id/:caty', lazyloadRouteHandler('./routes/hpoi/user')); - // 通用CurseForge router.get('/curseforge/:gameid/:catagoryid/:projectid/files', lazyloadRouteHandler('./routes/curseforge/generalfiles')); @@ -1038,9 +1002,6 @@ router.get('/cug/xgxy', lazyloadRouteHandler('./routes/universities/cug/xgxy')); router.get('/cug/news', lazyloadRouteHandler('./routes/universities/cug/news')); router.get('/cug/gcxy/:type?', lazyloadRouteHandler('./routes/universities/cug/gcxy/index')); -// 海猫吧 -router.get('/haimaoba/:id?', lazyloadRouteHandler('./routes/haimaoba/comics')); - // 蒲公英 router.get('/pgyer/:app?', lazyloadRouteHandler('./routes/pgyer/app')); @@ -1063,9 +1024,6 @@ router.get('/zhishifenzi/news/:type?', lazyloadRouteHandler('./routes/zhishifenz router.get('/zhishifenzi/depth', lazyloadRouteHandler('./routes/zhishifenzi/depth')); router.get('/zhishifenzi/innovation/:type?', lazyloadRouteHandler('./routes/zhishifenzi/innovation')); -// 電撃Online -router.get('/dengekionline/:type?', lazyloadRouteHandler('./routes/dengekionline/new')); - // 4Gamers router.get('/4gamers/category/:category', lazyloadRouteHandler('./routes/4gamers/category')); router.get('/4gamers/tag/:tag', lazyloadRouteHandler('./routes/4gamers/tag')); @@ -1117,9 +1075,6 @@ router.get('/gov/cnca/zxtz', lazyloadRouteHandler('./routes/gov/cnca/zxtz')); // 文汇报 router.get('/whb/:category', lazyloadRouteHandler('./routes/whb/zhuzhan')); -// 三界异次元 -router.get('/3ycy/home', lazyloadRouteHandler('./routes/3ycy/home.js')); - // Emi Nitta official website router.get('/emi-nitta/:type', lazyloadRouteHandler('./routes/emi-nitta/home')); @@ -1446,9 +1401,6 @@ router.get('/jijitang/publication', lazyloadRouteHandler('./routes/jijitang/publ // Grub Street // router.get('/grubstreet', lazyloadRouteHandler('./routes/grubstreet/index')); -// 漫画堆 -router.get('/manhuadui/manhua/:name/:serial?', lazyloadRouteHandler('./routes/manhuadui/manhua')); - // CFD indices dividend adjustment router.get('/cfd/gbp_div', lazyloadRouteHandler('./routes/cfd/gbp_div')); diff --git a/lib/routes/1draw/index.js b/lib/routes/1draw/index.js deleted file mode 100644 index 4411e3e7829bce..00000000000000 --- a/lib/routes/1draw/index.js +++ /dev/null @@ -1,44 +0,0 @@ -const got = require('@/utils/got'); - -function toJSONstr(content) { - // 使用了正则匹配 Javascript 数据,对字符串处理解析成 JSON,可能失效 - const dateRegex = /\[\];(?.*?)var/s; - return content - .match(dateRegex) - .groups.data.replace(/data\.push\(/gm, '') - .replace(/\);/gm, ',') - .replace(/(screen_name|id|allow|img):/gm, '"$1":'); -} - -module.exports = async (ctx) => { - const host = 'http://1draw.aqn.jp'; - - const response = await got(`${host}/1`); - const yesterday = response.data; - - let matches = toJSONstr(yesterday); - - // 东九区时间晚 10 点后尝试抓取今日 - if (new Date().getUTCHours() >= 13) { - const response = await got(`${host}/0`); - const today = response.data; - try { - matches += toJSONstr(today); - } catch (e) { - matches += ''; - } - } - - const matchArr = `[ ${matches.slice(0, matches.lastIndexOf(','))} ]`; - const items = JSON.parse(matchArr); - - ctx.state.data = { - title: '1draw', - link: 'http://1draw.aqn.jp/', - item: items.map((item) => ({ - title: `${item.screen_name}の投稿イラスト`, - description: ``, - link: `https://twitter.com/${item.screen_name}/status/${item.id}`, - })), - }; -}; diff --git a/lib/routes/3ycy/home.js b/lib/routes/3ycy/home.js deleted file mode 100644 index d36648a1c9809f..00000000000000 --- a/lib/routes/3ycy/home.js +++ /dev/null @@ -1,58 +0,0 @@ -const url = require('url'); -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const root_url = 'http://www.3ycy.com'; - const response = await got({ - method: 'get', - url: root_url, - }); - - const $ = cheerio.load(response.data); - const list = $('div.postList div.postItem'); - - const count = []; - for (let i = 0; i < Math.min(list.length, 10); ++i) { - count.push(i); - } - - const items = await Promise.all( - count.map((i) => { - const item = $(list[i]); - const title = item.find('h3 a').first(); - const link = title.attr('href'); - - return ctx.cache.tryGet('3ycy' + link, async () => { - const date = item.find('div.postSubtitle').text().trim(); - const match = /(\d+\/\d+\/\d{4}\s+\d+:\d+:\d+\s*(?:AM|PM))/i.exec(date); - const pubDate = match && new Date(match[1] + ' GMT+8').toUTCString(); - - const res = await got({ method: 'get', url: url.resolve(root_url, link) }); - const content = cheerio.load(res.data); - const post = content('div.postBody'); - post.find('img[data-src]').each((_, ele) => { - ele = content(ele); - ele.attr('src', ele.attr('data-src')); - ele.attr('alt', title.text()); - ele.attr('title', title.text()); - ele.removeAttr('class'); - ele.removeAttr('data-src'); - }); - - return { - title: title.text(), - link, - pubDate, - description: post.html(), - }; - }); - }) - ); - - ctx.state.data = { - title: '三界异次元', - link: root_url, - item: items, - }; -}; diff --git a/lib/routes/animen/news.js b/lib/routes/animen/news.js deleted file mode 100644 index b4a0f181907985..00000000000000 --- a/lib/routes/animen/news.js +++ /dev/null @@ -1,84 +0,0 @@ -const got = require('@/utils/got'); - -const news_api_origin = 'https://www.animen.com.tw/animen_web/api/getNews?page=1&perPage=10'; -const link_origin = 'https://www.animen.com.tw/animen_web/web/news_index?'; - -const map = new Map([ - ['zx', { title: '最新', id: -1 }], - ['jd', { title: '焦点', id: 0 }], - ['dh', { title: '动画', id: 16 }], - ['mh', { title: '漫画', id: 17 }], - ['yx', { title: '游戏', id: 19 }], - ['xs', { title: '小说', id: 18 }], - ['zrb', { title: '真人版', id: 24 }], - ['hd', { title: '活动', id: 20 }], - ['yy', { title: '音乐', id: 27 }], - ['ft', { title: '访谈', id: 25 }], - ['qt', { title: '其他', id: 22 }], - ['xwg', { title: '新闻稿', id: 26 }], - ['lrb', { title: '懒人包', id: 23 }], - ['gg', { title: '公告', id: 21 }], -]); -module.exports = async (ctx) => { - const type = ctx.params.type; - const sub_title = map.get(type).title; - - let news_api; - let link; - if (type === 'zx') { - news_api = news_api_origin + '&order_type=N'; - link = link_origin + '&order_type=N'; - } else if (type === 'jd') { - news_api = news_api_origin + '&order_type=H'; - link = link_origin + '&order_type=H'; - } else { - news_api = news_api_origin + '&news_category_id=' + map.get(type).id; - link = link_origin + '&news_category_id=' + map.get(type).id; - } - - const response = await got.get(news_api); - const newsList = response.data.news.NewsList; - - const out = await Promise.all( - newsList.map(async (news) => { - const title = news.subject; - const date = news.start_datetime; - const news_id = news.news_id; - const itemLink = `https://www.animen.com.tw/animen_web/web/news_inside?news_id=${news_id}`; - - const news_detail_api = `https://www.animen.com.tw/animen_web/api/getNewsDetail?news_id=${news_id}`; - const response = await got.get(news_detail_api); - const details = response.data.news_content.slice(1); - - const descriptions = details.map((detail) => { - let description; - if (detail.news_order_type === 'M') { - const id = detail.content.split('=')[1]; - description = ``; - } else if (detail.news_order_type === 'A') { - description = detail.content; - } else { - const image = detail.p_original_path; - description = `

`; - } - return description; - }); - const description = descriptions.join(''); - - const single = { - title, - link: itemLink, - description, - pubDate: new Date(date).toUTCString(), - }; - - return single; - }) - ); - - ctx.state.data = { - title: `${sub_title}-Animen动漫平台`, - link, - item: out, - }; -}; diff --git a/lib/routes/anitama/channel.js b/lib/routes/anitama/channel.js deleted file mode 100644 index 312764e29d2c17..00000000000000 --- a/lib/routes/anitama/channel.js +++ /dev/null @@ -1,64 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const date = require('@/utils/date'); - -module.exports = async (ctx) => { - const baseUrl = 'http://www.anitama.cn'; - const url = 'http://www.anitama.cn/channel/' + (ctx.params.channel ? ctx.params.channel : ''); - - const response = await got({ - method: 'get', - url, - }); - - const $ = cheerio.load(response.data); - const channel_name = $('#area-article-channel .bar').text().slice(0, -5); - const list = $('#area-article-channel div.inner a') - .slice(0, 10) - .map((i, e) => ({ - link: baseUrl + $(e).attr('href'), - })) - .get(); - - const out = await Promise.all( - list.map(async (item) => { - const { link } = item; - - const cache = await ctx.cache.get(link); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - const response = await got.get(link); - - const $ = cheerio.load(response.data); - const content = $('#area-content-article'); - content.find('img').each((index, item) => { - item = $(item); - item.attr('src', item.attr('data-src')); - }); - content.find('a').each((index, item) => { - if (item.attribs.href.startsWith('#')) { - item.tagName = 'span'; - } - }); - const single = { - pubDate: date($('.time').text()), - author: $('.author').text(), - link, - title: $('h1').text() + '-' + $('h2').text(), - description: content.html(), - }; - - ctx.cache.set(link, JSON.stringify(single)); - return Promise.resolve(single); - }) - ); - - ctx.state.data = { - title: 'Anitama-' + channel_name, - link: url, - description: 'Anitama-' + channel_name, - item: out, - }; -}; diff --git a/lib/routes/dengekionline/new.js b/lib/routes/dengekionline/new.js deleted file mode 100644 index 8b38bc9591664b..00000000000000 --- a/lib/routes/dengekionline/new.js +++ /dev/null @@ -1,133 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const host = 'https://dengekionline.com'; -const infos = { - '': { - category: '電撃総合', - patch: '/', - }, - dps: { - category: '電撃PlayStation', - patch: '/dps/', - }, - nintendo: { - category: '電撃Nintendo', - patch: '/nintendo/', - }, - microsoft: { - category: '電撃Xbox', - patch: '/microsoft/', - }, - dpc: { - category: '電撃PC', - patch: '/dpc/', - }, - gstyle: { - category: '電撃Girl’sStyle', - patch: '/g-style/', - }, - arcade: { - category: '電撃アーケードWeb', - patch: '/arcade/', - }, - app: { - category: 'アプリまとめ', - patch: '/app/', - }, - anime: { - category: 'アニメ', - patch: '/tags/%E3%82%A2%E3%83%8B%E3%83%A1/', - }, - review: { - category: 'レビューまとめ', - patch: '/tags/%E3%83%AC%E3%83%93%E3%83%A5%E3%83%BC/', - }, - rank: { - category: '販売ランキング', - patch: '/tags/%E3%82%BD%E3%83%95%E3%83%88%E8%B2%A9%E5%A3%B2%E3%83%A9%E3%83%B3%E3%82%AD%E3%83%B3%E3%82%B0/', - }, -}; - -module.exports = async (ctx) => { - // 设置参数 - const info = infos[ctx.params.type || '']; - if (info === undefined) { - throw Error('不存在的类型'); - } - const patch = info.patch.slice(1); - const category = info.category; - const title = `電撃オンライン - ${category}`; - // 网页请求获取新闻列表 - const response = await got(patch, { - method: 'get', - prefixUrl: host, - }); - const data = response.data; - const link = response.url; - // 过滤处理新闻列表数据 - const $ = cheerio.load(data); - const list = $('a', 'ul.gNews_list'); - const description = $('meta[name="description"]').attr('content'); - // 整理信息 - const item = await Promise.all( - list - .map(async (index, element) => { - const liArr = $('li', element); - const date = $('time', element).attr('datetime'); - - const newLink = $(element).attr('href').slice(1); - // 新闻封面 - const cover = $('img', element); - const category = liArr.map((index, li) => $(li).text()).get(); - // 日本时区为东9区 - const pubDate = new Date(`${date} GMT+0900`).toUTCString(); - // 获取作者等 - const newInfo = await ctx.cache.tryGet(newLink, async () => { - // console.log(newLink); - const result = await got(newLink, { - method: 'get', - prefixUrl: host, - }); - const $ = cheerio.load(result.data); - const title = $('.gEntry_title').text(); - const description = $('p', '.gEntry_body').html(); - const author = $('dd', '.gEntry_athorList').text(); - const info = { - title, - description, - author, - url: result.url, - }; - return info; - }); - - const single = { - title: newInfo.title, - link: newInfo.url, - category, - description: newInfo.description, - media: { - content: { - url: cover.attr('data-src'), - expression: 'full', - width: cover.attr('width'), - }, - }, - author: newInfo.author, - guid: newInfo.url, - pubDate, - }; - return Promise.resolve(single); - }) - .get() - ); - // 设置rss - ctx.state.data = { - title, - description, - link, - language: 'ja-jp', - item, - }; -}; diff --git a/lib/routes/dilidili/fanju.js b/lib/routes/dilidili/fanju.js deleted file mode 100644 index 4cd375ac115c56..00000000000000 --- a/lib/routes/dilidili/fanju.js +++ /dev/null @@ -1,78 +0,0 @@ -// 调用got获取页面源码 -const got = require('@/utils/got'); -// 调用cheerio分析抓取到的html,利用类似jQuery的方法解析 -const cheerio = require('cheerio'); - -async function load(link, ctx) { - // 定义cache 存储通过link获取到的缓存内容 - const cache = await ctx.cache.get(link); - // 如果缓存已经存在,则直接返回,否则对其进行解析 - if (cache) { - return cache; - } - const response = await got.get(link); - const $ = cheerio.load(response.data); - // 获取相关内容 - let introduce = $('#intro2 > p:nth-child(3)').text(); - // 将'简介'字段与内容分离,为了更优美的阅读界面 - introduce = introduce.replace('简介', '简介
'); - const image = ``; - const detailResult = `${introduce}
${image}`; - - // 定义description,并指定内容 - const description = detailResult; - ctx.cache.set(link, description); - return { - description, - }; -} - -// 通过module.exports暴露给router -module.exports = async (ctx) => { - const id = ctx.params.id; - - // 使用get方法请求主页面,然后获取其返回的response - const response = await got({ - method: 'get', - url: `http://www.dilidili.name/anime/${id}`, - }); - // 获取页面的html - const data = response.data; - // 将页面html交于cheerio处理成类似jQuery的节点 - const $ = cheerio.load(data); - // 获取番剧名称 - const animeName = $('body > div.container.clear > div.clear > div:nth-child(2) > div.detail.con24.clear > dl > dd > h1').text(); - - // @param {*} list 用于存储通过 " h4 > a "获取到的节点 - const beforeFilterList = $('div.swiper-container.xfswiper1 > div > div > ul > li > a').get(); // 获取到剧集列表 - const list = []; - beforeFilterList.forEach((element) => { - if ($(element).attr('href').indexOf('http://') !== -1) { - list.push(element); - } - }); - // 使用promise处理多个节点 - const process = await Promise.all( - // 在list变量上使用map方法,对其拥有的每一个元素均进行"匿名函数"的操作 - list.map(async (item) => { - // item为回调的参数 - // 定义itemUrl - const itemUrl = $(item).attr('href'); - // 定义导出到rss的单体对象,包含title,link,guid三个参数 - const single = { - title: $(item).text(), - link: itemUrl, - guid: itemUrl, - }; - // 调用load方法,获取到的是string对象{description} - const other = await load(itemUrl, ctx); - return Promise.resolve(Object.assign({}, single, other)); - }) - ); - ctx.state.data = { - title: `${animeName} - 嘀哩嘀哩`, - link: `http://www.dilidili.name/anime/${id}`, - description: `${animeName}更新提醒`, - item: process, - }; -}; diff --git a/lib/routes/galgame/hhgal.js b/lib/routes/galgame/hhgal.js deleted file mode 100644 index 50664d89194163..00000000000000 --- a/lib/routes/galgame/hhgal.js +++ /dev/null @@ -1,70 +0,0 @@ -const cheerio = require('cheerio'); -const got = require('@/utils/got'); -const { CookieJar } = require('tough-cookie'); - -module.exports = async (ctx) => { - const baseUrl = 'https://www.hhgal.com/'; - const stringToHex = (str) => { - let val = ''; - for (let i = 0; i < str.length; i++) { - if (val === '') { - val = str.charCodeAt(i).toString(16); - } else { - val += str.charCodeAt(i).toString(16); - } - } - return val; - }; - - const cookieJar = new CookieJar(); - const response = ( - await got({ - url: baseUrl, - cookieJar, - }) - ).body; - let html = null; - - if (response.indexOf('YunSuoAutoJump') > -1) { - const screenData = stringToHex('1280,720'); - const urlData = stringToHex(baseUrl); - cookieJar.setCookie('srcurl=' + urlData, baseUrl); - await got({ - url: baseUrl + '?security_verify_data=' + screenData, - cookieJar, - }); - html = ( - await got({ - url: baseUrl, - cookieJar, - }) - ).body; - } - - const $ = html === null ? cheerio.load(response) : cheerio.load(html); - const list = $('#article-list').find('.article'); - - ctx.state.data = { - title: $('title').text(), - link: 'https://www.hhgal.com/', - description: '忧郁的loli - Galgame资源发布站', - item: - list && - list - .slice(1) - .map((index, item) => { - item = $(item); - const time = item.find('.tag-article .label.label-zan').text(); - const math = /\d{4}-\d{2}-\d{2}/.exec(time); - const pubDate = new Date(math[0]); - - return { - title: item.find('h1').text(), - description: item.find('.info p').text(), - pubDate, - link: item.find('h1 a').attr('href'), - }; - }) - .get(), - }; -}; diff --git a/lib/routes/galgame/sayhuahuo.js b/lib/routes/galgame/sayhuahuo.js deleted file mode 100644 index 555585ce257312..00000000000000 --- a/lib/routes/galgame/sayhuahuo.js +++ /dev/null @@ -1,22 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const res = await got({ - method: 'get', - url: 'https://index.say-huahuo.com/vn.json', - }); - - const data = JSON.parse(res.body).reverse(); - - ctx.state.data = { - title: 'galgame汉化硬盘galgame资源下载-花火学园论坛', - link: 'https://index.say-huahuo.com/', - description: '花火学园', - item: data.map((item) => ({ - title: item.title, - description: ``, - pubDate: new Date(parseInt(item.date.substr(0, 4)), parseInt(item.date.substr(4, 2)), parseInt(item.date.substr(6, 2))).toUTCString(), - link: item.url, - })), - }; -}; diff --git a/lib/routes/galgame/zdfx.js b/lib/routes/galgame/zdfx.js deleted file mode 100644 index c60df28665c928..00000000000000 --- a/lib/routes/galgame/zdfx.js +++ /dev/null @@ -1,30 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const host = 'https://bbs.zdfx.net/'; - -module.exports = async (ctx) => { - const response = await got({ - 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(), - }; -}; diff --git a/lib/routes/haimaoba/comics.js b/lib/routes/haimaoba/comics.js deleted file mode 100644 index fd594bb08e1869..00000000000000 --- a/lib/routes/haimaoba/comics.js +++ /dev/null @@ -1,57 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const iconv = require('iconv-lite'); - -const getChapters = (id, $, caches) => { - const chapters = $('.text') - .toArray() - .reduce((acc, curr) => acc.concat(`http://www.haimaoba.com${$(curr).children('a').attr('href')}`), []); - - return Promise.all( - chapters.splice(0, 10).map((link) => - caches.tryGet(link, async () => { - const { data } = await got.get(link, { - responseType: 'buffer', - host: 'www.haimaoba.com', - Referer: `http://www.haima.com/catalog/${id}/`, - }); - const content = iconv.decode(new Buffer.from(data), 'gb2312'); - const $ = cheerio.load(content); - return { - title: $('head > title').text(), - link, - description: $('.contentimg').html(), - }; - }) - ) - ); -}; - -module.exports = async (ctx) => { - const id = ctx.params.id; - - const { data } = await got.get(`http://www.haimaoba.com/catalog/${id}/`, { - responseType: 'buffer', - Host: 'www.haimaoba.com', - Referer: 'http://www.haimaoba.com/', - }); - const content = iconv.decode(new Buffer.from(data), 'gb2312'); - const $ = cheerio.load(content); - - const bookTitle = $('.t > h1').text(); - const bookIntro = $('#zuop1C').text(); - const chapters = await getChapters(id, $, ctx.cache); - - const rssData = (chapter) => ({ - link: chapter.link, - title: chapter.title, - description: chapter.description, - }); - - ctx.state.data = { - title: `海猫吧 - ${bookTitle}`, - link: `http://www.haimaoba.com/catalog/${id}/`, - description: bookIntro, - item: chapters.map(rssData), - }; -}; diff --git a/lib/routes/hpoi/index.js b/lib/routes/hpoi/index.js deleted file mode 100644 index faedc1f75a7405..00000000000000 --- a/lib/routes/hpoi/index.js +++ /dev/null @@ -1,47 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const host = 'https://www.hpoi.net'; - -const MAPs = { - charactar: { - url: `${host}/hobby/all?charactar={words}&order=release`, - title: '角色手办', - }, - works: { - url: `${host}/hobby/all?works={words}&order=release`, - title: '作品手办', - }, -}; - -module.exports = async (ctx) => { - const category = ctx.params && ctx.params.category; - const words = ctx.params && ctx.params.words; - const link = MAPs[category].url.replace(/{words}/, words); - const response = await got({ - method: 'get', - url: link, - headers: { - Referer: host, - }, - }); - const $ = cheerio.load(response.data); - ctx.state.data = { - title: 'Hpoi 手办维基' + ' - ' + $(`#${category}`).text().trim(), - link, - item: $('.bs-glyphicons-list .detail-grid') - .map((_index, _item) => { - _item = $(_item); - return { - title: _item.find('.detail-grid-title').text(), - link: host + '/' + _item.find('.detail-grid-title a').attr('href'), - description: `${_item.find('.detail-grid-info span').eq(0).text()}
${_item.find('.detail-grid-info span').eq(1).text()}
${_item - .find('.detail-grid-info span') - .eq(2) - .text()}`, - }; - }) - .get() - .reverse(), - }; -}; diff --git a/lib/routes/hpoi/user.js b/lib/routes/hpoi/user.js deleted file mode 100644 index abcd0340012e74..00000000000000 --- a/lib/routes/hpoi/user.js +++ /dev/null @@ -1,37 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -const root_url = 'https://www.hpoi.net'; - -module.exports = async (ctx) => { - const { user_id, caty } = ctx.params; - - const url = `${root_url}/user/${user_id}/hobby?order=actionDate&favState=${caty}&view=5&category=100&sortType=2`; - const response = await got({ - method: 'get', - url, - }); - - const $ = cheerio.load(response.data); - const list = $('#content > div.action-box div.action-detail') - .map((_, item) => { - item = $(item); - const img = item.find('div.list-5-left > a > img').attr('src'); - const a = item.find('div.list-5-right > a.action-title'); - return { - title: a.text(), - link: 'https://www.hpoi.net/' + a.attr('href'), - description: `
制作:${item.find('.badge').eq(0).text()}
发售:${item.find('.badge').eq(1).text()}`, - }; - }) - .get(); - - const title = $('div.col-md-15.col-sm-15 > div:nth-child(2)').text() + $('.navbar-nav .active').eq(0).text() + '的手办'; - - ctx.state.data = { - title, - link: url, - item: list, - allowEmpty: true, - }; -}; diff --git a/lib/routes/manhuadui/manhua.js b/lib/routes/manhuadui/manhua.js deleted file mode 100644 index 367bde5da47ef5..00000000000000 --- a/lib/routes/manhuadui/manhua.js +++ /dev/null @@ -1,36 +0,0 @@ -const got = require('@/utils/got'); -const host = 'https://www.manhuadui.com'; -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const name = ctx.params.name; - const serial = parseInt(ctx.params.serial); - const comicPage = host + `/manhua/${name}/`; - const response = await got({ - method: 'get', - url: comicPage, - }); - const data = response.data; - const $ = cheerio.load(data); - const contentLength = $('div.zj_list_con').length; - const comicTitle = $('div.comic_deCon > h1').text().trim(); - const comicDescription = $('p.comic_deCon_d').text().trim(); - let list = $('div.zj_list_con') - .eq(serial - 1) - .find('ul > li > a'); - if (isNaN(serial) || serial <= 0 || contentLength < serial) { - list = $('div.zj_list_con > ul > li > a'); - } - ctx.state.data = { - title: '漫画堆 - ' + comicTitle, - link: comicPage, - description: comicDescription, - item: list - .map((i, item) => ({ - title: $(item).attr('title').trim(), - description: $(item).attr('title').trim(), - link: host + $(item).attr('href'), - })) - .get(), - }; -}; diff --git a/lib/routes/shuhui/comics.js b/lib/routes/shuhui/comics.js deleted file mode 100644 index 270da4e597f5b8..00000000000000 --- a/lib/routes/shuhui/comics.js +++ /dev/null @@ -1,95 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const id = ctx.params.id; - - const api_data = await got.get('https://prod-u.ishuhui.com/ver'); - const comics_code = api_data.data.data.comics; - - let lastEpisodeId; - const rssData = await got({ - method: 'get', - url: `https://prod-api.ishuhui.com/ver/${comics_code}/anime/detail?id=${id}&type=comics&.json`, - headers: { - Origin: 'https://www.ishuhui.com', - Referer: `https://www.ishuhui.com/comics/anime/${id}`, - }, - }).then((response) => { - // 漫画名 - const name = response.data.data.name; - // 漫画描述 - const desc = response.data.data.desc; - - const episodeGroup = response.data.data.comicsIndexes['1'].nums; - let lastGroup = '0'; - for (const key in episodeGroup) { - if (parseInt(lastGroup.split('-')[0]) < parseInt(key.split('-')[0])) { - lastGroup = key; - } - } - - // 找到最新章节组 - let lastEpisode = '-1'; - for (const group in episodeGroup[lastGroup]) { - if (parseInt(lastEpisode) < parseInt(group)) { - lastEpisode = group; - } - } - - // 最新章节id - lastEpisodeId = episodeGroup[lastGroup][lastEpisode][0].id; - - return { - name, - desc, - }; - }); - - let description = ''; - const data = await got({ - method: 'get', - url: `https://prod-api.ishuhui.com/comics/detail?id=${lastEpisodeId}`, - headers: { - Origin: 'https://www.ishuhui.com', - Referer: `https://www.ishuhui.com/comics/detail/${lastEpisodeId}`, - }, - }).then((response) => { - const picUrlArray = response.data.data.contentImg; - const rssTitle = response.data.data.animeName; - const title = response.data.data.title; - const index = response.data.data.numberEnd; - const updateTime = response.data.data.updateTime; - for (let i = 0; i < picUrlArray.length; i++) { - description += `
`; - } - - const item = { - rssTitle, - title, - description, - index, - updateTime, - }; - return [item]; - }); - - ctx.state.data = { - // 源标题 - title: rssData.name, - // 源链接 - link: `https://www.ishuhui.com/comics/anime/${id}`, - // 源说明 - description: rssData.desc, - // 遍历此前获取的数据 - item: data.map((item) => ({ - // 文章标题 - title: `第${item.index}话-${item.title}`, - // 文章正文 - description: item.description, - // 文章发布时间 - pubDate: new Date(item.updateTime).toUTCString(), - // 文章链接 - link: `http://www.hanhuazu.cc/comics/detail/${lastEpisodeId}`, - })), - }; -}; diff --git a/lib/routes/vgtime/keyword.js b/lib/routes/vgtime/keyword.js deleted file mode 100644 index 94585480592779..00000000000000 --- a/lib/routes/vgtime/keyword.js +++ /dev/null @@ -1,46 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const { keyword = '' } = ctx.params; - const response = await got({ - method: 'get', - url: `http://www.vgtime.com/search/load.jhtml?keyword=${encodeURIComponent(keyword)}&type=topic&typeTag=2&page=1&pageSize=12`, - headers: { - Referer: `http://www.vgtime.com/search/list.jhtml?keyword=${encodeURIComponent(keyword)}`, - }, - }); - const data = response.data.data; - - const result = await Promise.all( - data.map(async (item) => { - const url = `https://www.vgtime.com/topic/${item.objectId}.jhtml`; - - const description = await ctx.cache.tryGet(url, async () => { - const result = await got.get(url); - - const $ = cheerio.load(result.data); - $('h1.art_tit').remove(); - $('.editor_name').remove(); - - return $('.vg_main article').html(); - }); - - const result = { - title: item.title, - author: JSON.parse(item.content).userName, - pubDate: new Date(item.createTime * 1000).toUTCString(), - link: url, - description, - }; - - return Promise.resolve(result); - }) - ); - - ctx.state.data = { - title: `游戏时光${keyword}资讯`, - link: `http://www.vgtime.com/search/list.jhtml?keyword=${encodeURIComponent(keyword)}`, - item: result, - }; -}; diff --git a/lib/routes/vgtime/news.js b/lib/routes/vgtime/news.js deleted file mode 100644 index 16d932daff4350..00000000000000 --- a/lib/routes/vgtime/news.js +++ /dev/null @@ -1,52 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: `http://www.vgtime.com/vgtime-app/api/v2/homepage/listByTag.json?page=1&pageSize=20&tags=1`, - }); - const data = response.data.data.topicList; - - const result = await Promise.all( - data.map(async (item) => { - const postId = item.postId; - const cacheKey = `vgtime_${postId}`; - - // 最终需要返回的对象 - const news = { - title: item.title || item.text, - author: item.author || item.user.name, - pubDate: new Date(item.publishDate * 1000).toUTCString(), - link: item.shareUrl, - }; - - // 判断缓存中是否存在 - const cacheValue = await ctx.cache.get(cacheKey); - if (cacheValue) { - news.description = cacheValue; - } else { - const article = await got({ - method: 'get', - url: `https://www.vgtime.com/topic/${postId}.jhtml`, - }); - // 解析html内容 - const $ = cheerio.load(article.data); - $('h1.art_tit').remove(); - $('.editor_name').remove(); - const content = $('.vg_main article').html(); - // 存放到缓存区 - ctx.cache.set(cacheKey, content); - news.description = content; - } - - return Promise.resolve(news); - }) - ); - - ctx.state.data = { - title: `游戏时光新闻列表`, - link: `http://www.vgtime.com/topic/index.jhtml`, - item: result, - }; -}; diff --git a/lib/routes/vgtime/release.js b/lib/routes/vgtime/release.js deleted file mode 100644 index 615230fea0d52f..00000000000000 --- a/lib/routes/vgtime/release.js +++ /dev/null @@ -1,20 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const response = await got({ - method: 'get', - url: `http://app02.vgtime.com:8080/vgtime-app/api/v2/game/last/sales`, - }); - const data = response.data.data.gameList; - - ctx.state.data = { - title: `游戏时光游戏发售表`, - link: `https://www.vgtime.com/game/release.jhtml`, - item: data.map((item) => ({ - title: item.title, - description: `平台:${item.platformsText};${item.introduction}`, - pubDate: item.publishDate, - link: item.shareUrl, - })), - }; -}; diff --git a/lib/v2/blockbeats/index.js b/lib/v2/blockbeats/index.js deleted file mode 100644 index 0f702671eaccff..00000000000000 --- a/lib/v2/blockbeats/index.js +++ /dev/null @@ -1,43 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); -const { parseDate } = require('@/utils/parse-date'); -const newflashApi = 'https://api.theblockbeats.info/v3/newsflash/select'; -const articleApi = 'https://api.theblockbeats.info/v3/Information/newsall'; - -const rootUrl = 'https://www.theblockbeats.info'; - -const channelMap = { - newsflash: '快讯', - article: '文章', -}; - -module.exports = async (ctx) => { - const channel = ctx.params.channel ?? 'newsflash'; - const { data: response } = await got(channel === 'newsflash' ? newflashApi : articleApi); - const { data } = channel === 'newsflash' ? response.data : response; - const list = data.map((item) => ({ - title: item.title, - link: `${rootUrl}/${channel === 'newsflash' ? 'flash' : 'news'}/${item.id}`, - description: item.content ?? item.im_abstract, - pubDate: parseDate(item.add_time, 'X'), - })); - - if (channel !== 'newsflash') { - await Promise.all( - list.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got(item.link); - const content = cheerio.load(detailResponse.data); - item.description = content('div.news-content').html(); - return item; - }) - ) - ); - } - - ctx.state.data = { - title: `TheBlockBeats - ${channelMap[channel]}`, - link: rootUrl, - item: list, - }; -}; diff --git a/lib/v2/blockbeats/maintainer.js b/lib/v2/blockbeats/maintainer.js deleted file mode 100644 index 76c0d214954dc1..00000000000000 --- a/lib/v2/blockbeats/maintainer.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - '/:channel?': ['Fatpandac', 'jameshih'], -}; diff --git a/lib/v2/blockbeats/radar.js b/lib/v2/blockbeats/radar.js deleted file mode 100644 index 3ccde68c4e83df..00000000000000 --- a/lib/v2/blockbeats/radar.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - 'theblockbeats.info': { - _name: '律动', - rszhaopin: [ - { - title: '快讯', - docs: 'https://docs.rsshub.app/routes/new-media#lu-dong-xin-wen-kuai-xun', - source: ['/'], - target: '/blockbeats/newsflash', - }, - { - title: '文章', - docs: 'https://docs.rsshub.app/routes/new-media#lu-dong-xin-wen-kuai-xun', - source: ['/'], - target: '/blockbeats/article', - }, - ], - }, -}; diff --git a/lib/v2/blockbeats/router.js b/lib/v2/blockbeats/router.js deleted file mode 100644 index 91b8719d6673ee..00000000000000 --- a/lib/v2/blockbeats/router.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function (router) { - router.get('/:channel?', require('./index')); -}; diff --git a/lib/v2/hpoi/all.js b/lib/v2/hpoi/all.js new file mode 100644 index 00000000000000..593123a1109f22 --- /dev/null +++ b/lib/v2/hpoi/all.js @@ -0,0 +1,3 @@ +const { ProcessFeed } = require('./utils'); + +module.exports = async (ctx) => (ctx.state.data = await ProcessFeed('all', 0, ctx.params.order)); diff --git a/lib/v2/hpoi/bannerItem.js b/lib/v2/hpoi/bannerItem.js new file mode 100644 index 00000000000000..2a4df24bbb4caa --- /dev/null +++ b/lib/v2/hpoi/bannerItem.js @@ -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: ``, + pubDate: new Date(_item.find('.time').text().replace('发布时间:', '')).toUTCString(), + }; + }) + .get(), + }; +}; diff --git a/lib/v2/hpoi/character.js b/lib/v2/hpoi/character.js new file mode 100644 index 00000000000000..5e6e67e6a2087a --- /dev/null +++ b/lib/v2/hpoi/character.js @@ -0,0 +1,3 @@ +const { ProcessFeed } = require('./utils'); + +module.exports = async (ctx) => (ctx.state.data = await ProcessFeed('character', ctx.params.id, ctx.params.order)); diff --git a/lib/routes/hpoi/info.js b/lib/v2/hpoi/info.js similarity index 100% rename from lib/routes/hpoi/info.js rename to lib/v2/hpoi/info.js diff --git a/lib/v2/hpoi/maintainer.js b/lib/v2/hpoi/maintainer.js new file mode 100644 index 00000000000000..2dccb10bcce6ea --- /dev/null +++ b/lib/v2/hpoi/maintainer.js @@ -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'], +}; diff --git a/lib/v2/hpoi/radar.js b/lib/v2/hpoi/radar.js new file mode 100644 index 00000000000000..53a25bc55a498e --- /dev/null +++ b/lib/v2/hpoi/radar.js @@ -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', + }, + ], + }, +}; diff --git a/lib/v2/hpoi/router.js b/lib/v2/hpoi/router.js new file mode 100644 index 00000000000000..bcbe542fbd16af --- /dev/null +++ b/lib/v2/hpoi/router.js @@ -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')); +}; diff --git a/lib/v2/hpoi/user.js b/lib/v2/hpoi/user.js new file mode 100644 index 00000000000000..adcf14b68fae58 --- /dev/null +++ b/lib/v2/hpoi/user.js @@ -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: `
${item.find('.pay').text()}
${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, + }; +}; diff --git a/lib/v2/hpoi/utils.js b/lib/v2/hpoi/utils.js new file mode 100644 index 00000000000000..a3715b59a7a512 --- /dev/null +++ b/lib/v2/hpoi/utils.js @@ -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: `${_item.find('.hpoi-detail-grid-info').html().replace(/span>/g, 'p>')}`, + }; + }) + .get(), + }; +}; + +module.exports = { + ProcessFeed, +}; diff --git a/lib/v2/hpoi/work.js b/lib/v2/hpoi/work.js new file mode 100644 index 00000000000000..5b9c1980b9cc62 --- /dev/null +++ b/lib/v2/hpoi/work.js @@ -0,0 +1,3 @@ +const { ProcessFeed } = require('./utils'); + +module.exports = async (ctx) => (ctx.state.data = await ProcessFeed('work', ctx.params.id, ctx.params.order)); diff --git a/package.json b/package.json index 7879d11765d9f2..98f7b23d7223d4 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "@stylistic/eslint-plugin-js": "1.5.1", "@types/aes-js": "3.1.4", "@types/crypto-js": "4.2.1", - "@types/eslint": "8.44.9", + "@types/eslint": "8.56.0", "@types/eslint-config-prettier": "6.11.3", "@types/etag": "1.8.3", "@types/fs-extra": "11.0.4", @@ -185,7 +185,7 @@ "cross-env": "7.0.3", "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", - "eslint-plugin-n": "16.4.0", + "eslint-plugin-n": "16.5.0", "eslint-plugin-prettier": "5.1.0", "eslint-plugin-yml": "1.11.0", "fs-extra": "11.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bf7ecfc4eb7637..09ed441ab1cfc7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -218,8 +218,8 @@ devDependencies: specifier: 4.2.1 version: 4.2.1 '@types/eslint': - specifier: 8.44.9 - version: 8.44.9 + specifier: 8.56.0 + version: 8.56.0 '@types/eslint-config-prettier': specifier: 6.11.3 version: 6.11.3 @@ -308,11 +308,11 @@ devDependencies: specifier: 9.1.0 version: 9.1.0(eslint@8.56.0) eslint-plugin-n: - specifier: 16.4.0 - version: 16.4.0(eslint@8.56.0) + specifier: 16.5.0 + version: 16.5.0(eslint@8.56.0) eslint-plugin-prettier: specifier: 5.1.0 - version: 5.1.0(@types/eslint@8.44.9)(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) + version: 5.1.0(@types/eslint@8.56.0)(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1) eslint-plugin-yml: specifier: 1.11.0 version: 1.11.0(eslint@8.56.0) @@ -1474,8 +1474,8 @@ packages: resolution: {integrity: sha512-3wXCiM8croUnhg9LdtZUJQwNcQYGWxxdOWDjPe1ykCqJFPVpzAKfs/2dgSoCtAvdPeaponcWPI7mPcGGp9dkKQ==} dev: true - /@types/eslint@8.44.9: - resolution: {integrity: sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw==} + /@types/eslint@8.56.0: + resolution: {integrity: sha512-FlsN0p4FhuYRjIxpbdXovvHQhtlG05O1GG/RNWvdAxTboR438IOTwmrY/vLA+Xfgg06BTkP045M3vpFwTMv1dg==} dependencies: '@types/estree': 1.0.1 '@types/json-schema': 7.0.12 @@ -3313,8 +3313,8 @@ packages: eslint-compat-utils: 0.1.2(eslint@8.56.0) dev: true - /eslint-plugin-n@16.4.0(eslint@8.56.0): - resolution: {integrity: sha512-IkqJjGoWYGskVaJA7WQuN8PINIxc0N/Pk/jLeYT4ees6Fo5lAhpwGsYek6gS9tCUxgDC4zJ+OwY2bY/6/9OMKQ==} + /eslint-plugin-n@16.5.0(eslint@8.56.0): + resolution: {integrity: sha512-Hw02Bj1QrZIlKyj471Tb1jSReTl4ghIMHGuBGiMVmw+s0jOPbI4CBuYpGbZr+tdQ+VAvSK6FDSta3J4ib/SKHQ==} engines: {node: '>=16.0.0'} peerDependencies: eslint: '>=7.0.0' @@ -3332,7 +3332,7 @@ packages: semver: 7.5.4 dev: true - /eslint-plugin-prettier@5.1.0(@types/eslint@8.44.9)(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): + /eslint-plugin-prettier@5.1.0(@types/eslint@8.56.0)(eslint-config-prettier@9.1.0)(eslint@8.56.0)(prettier@3.1.1): resolution: {integrity: sha512-hQc+2zbnMeXcIkg+pKZtVa+3Yqx4WY7SMkn1PLZ4VbBEU7jJIpVn9347P8BBhTbz6ne85aXvQf30kvexcqBeWw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3346,7 +3346,7 @@ packages: eslint-config-prettier: optional: true dependencies: - '@types/eslint': 8.44.9 + '@types/eslint': 8.56.0 eslint: 8.56.0 eslint-config-prettier: 9.1.0(eslint@8.56.0) prettier: 3.1.1 diff --git a/website/docs/routes/anime.mdx b/website/docs/routes/anime.mdx index c7c1708ca7341a..04591ba43698f1 100644 --- a/website/docs/routes/anime.mdx +++ b/website/docs/routes/anime.mdx @@ -6,12 +6,6 @@ -## 1draw #深夜の真剣お絵描き 60 分一本勝負 {#1draw-shen-ye-%E3%81%AE-zhen-jian-%E3%81%8A-hui-miao-%E3%81%8D-60-fen-yi-ben-sheng-fu} - -### 投稿一览 {#1draw-shen-ye-%E3%81%AE-zhen-jian-%E3%81%8A-hui-miao-%E3%81%8D-60-fen-yi-ben-sheng-fu-tou-gao-yi-lan} - - - ## 78 动漫 {#78-dong-man} ### 新品速递 {#78-dong-man-xin-pin-su-di} @@ -103,16 +97,6 @@ -## Animen 动漫平台 {#animen-dong-man-ping-tai} - -### news {#animen-dong-man-ping-tai-news} - - - | 最新 | 焦点 | 动画 | 漫画 | 游戏 | 小说 | 真人版 | 活动 | 音乐 | 访谈 | 其他 | 新闻稿 | 懒人包 | 公告 | - | ---- | ---- | ---- | ---- | ---- | ---- | ------ | ---- | ---- | ---- | ---- | ------ | ------ | ---- | - | zx | jd | dh | mh | yx | xs | zrb | hd | yy | ft | qt | xwg | lrb | gg | - - ## Anitama {#anitama} ### Anitama Channel {#anitama-anitama-channel} @@ -279,22 +263,42 @@ | all | hobby | model | -### 浏览周边 {#hpoi-shou-ban-wei-ji-liu-lan-zhou-bian} +### 所有周边 {#hpoi-shou-ban-wei-ji-suo-you-zhou-bian} + + + | 发售 | 入库 | 总热度 | 一周热度 | 一天热度 | 评价 | + | ------- | ---- | ------ | -------- | -------- | ------ | + | release | add | hits | hits7Day | hitsDay | rating | + + +### 角色周边 {#hpoi-shou-ban-wei-ji-jue-se-zhou-bian} + + + | 发售 | 入库 | 总热度 | 一周热度 | 一天热度 | 评价 | + | ------- | ---- | ------ | -------- | -------- | ------ | + | release | add | hits | hits7Day | hitsDay | rating | + + +### 作品周边 {#hpoi-shou-ban-wei-ji-zuo-pin-zhou-bian} - - | 角色手办 | 作品手办 | - | --------- | -------- | - | charactar | works | + + | 发售 | 入库 | 总热度 | 一周热度 | 一天热度 | 评价 | + | ------- | ---- | ------ | -------- | -------- | ------ | + | release | add | hits | hits7Day | hitsDay | rating | ### 用户动态 {#hpoi-shou-ban-wei-ji-yong-hu-dong-tai} - + | 想买 | 预定 | 已入 | 关注 | 有过 | | ---- | -------- | ---- | ---- | ------ | | want | preorder | buy | care | resell | +### 热门推荐 {#hpoi-shou-ban-wei-ji-re-men-tui-jian} + + + ## IDOLY PRIDE 偶像荣耀 {#idoly-pride-ou-xiang-rong-yao} ### News {#idoly-pride-ou-xiang-rong-yao-news} @@ -450,12 +454,6 @@ -## say 花火 {#say-hua-huo} - -### 文章 {#say-hua-huo-wen-zhang} - - - ## THBWiki {#thbwiki} ### Calendar {#thbwiki-calendar} @@ -564,26 +562,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 嘀哩嘀哩 - dilidili {#di-li-di-li-dilidili} - -### 嘀哩嘀哩番剧更新 {#di-li-di-li-dilidili-di-li-di-li-fan-ju-geng-xin} - - - 请打开对应番剧的纵览页 (非具体某集), 从 url 中最后一位查看番剧 id.(一般为英文) - 除去 ' 海贼 ' 此类具有特殊页面的超长番剧,绝大多数页面都可以解析. - 最适合用来追新番 - - -## 電撃オンライン {#dian-ji-%E3%82%AA%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3} - -### 最新記事 {#dian-ji-%E3%82%AA%E3%83%B3%E3%83%A9%E3%82%A4%E3%83%B3-zui-xin-ji-shi} - - - | All | PlayStation | Nintendo | Xbox | PC | Girl’sStyle | Arcade Web | App | Anime | Review | Rank | - | --- | ----------- | -------- | --------- | --- | ----------- | ---------- | --- | ----- | ------ | ---- | - | | dps | nintendo | microsoft | dpc | gstyle | arcade | app | anime | review | rank | - - ## 咚漫 {#dong-man} ### 漫画更新 {#dong-man-man-hua-geng-xin} @@ -628,12 +606,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 海猫吧 {#hai-mao-ba} - -### 漫画更新 {#hai-mao-ba-man-hua-geng-xin} - - - ## 禁漫天堂 {#jin-man-tian-tang} :::tip @@ -728,12 +700,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 漫画堆 {#man-hua-dui} - -### 漫画 {#man-hua-dui-man-hua} - - - ## 漫小肆 {#man-xiao-si} ### 漫画更新 {#man-xiao-si-man-hua-geng-xin} @@ -746,12 +712,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 三界异次元 {#san-jie-yi-ci-yuan} - -### 三界异次元 {#san-jie-yi-ci-yuan-san-jie-yi-ci-yuan} - - - ## 紳士漫畫 {#shen-shi-man-hua} ### 最新 {#shen-shi-man-hua-zui-xin} @@ -766,12 +726,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 鼠绘漫画 {#shu-hui-man-hua} - -### 鼠绘漫画 {#shu-hui-man-hua-shu-hui-man-hua} - - - ## 腾讯动漫 {#teng-xun-dong-man} ### 排行榜 {#teng-xun-dong-man-pai-hang-bang} @@ -790,12 +744,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 忧郁的 loli {#you-yu-de-loli} - -### 文章 {#you-yu-de-loli-wen-zhang} - - - ## 月幕 Galgame {#yue-mu-galgame} ### 文章 {#yue-mu-galgame-wen-zhang} @@ -810,12 +758,6 @@ You can use some RSS parsing libraries (like `feedpraser` in `Python`) to receiv -## 终点分享 {#zhong-dian-fen-xiang} - -### 最新汉化 {#zhong-dian-fen-xiang-zui-xin-han-hua} - - - ## アニメ新番組 {#%E3%82%A2%E3%83%8B%E3%83%A1-xin-fan-zu} ### 當季新番 {#%E3%82%A2%E3%83%8B%E3%83%A1-xin-fan-zu-dang-ji-xin-fan} diff --git a/website/docs/routes/new-media.mdx b/website/docs/routes/new-media.mdx index 2b653c4e33e007..e2ef61bb66f537 100644 --- a/website/docs/routes/new-media.mdx +++ b/website/docs/routes/new-media.mdx @@ -3432,16 +3432,6 @@ [**甲醇热点聚焦**](https://list.oilchem.net/140/18263) `https://list.oilchem.net/140/18263` 中,类别 id 为 `list`,分类 id 为 `140`,子分类 id 为 `18263`,对应路由即为 [`/oilchem/list/140/18263`](https://rsshub.app/oilchem/list/140/18263) -## 律动 {#lv-dong} - -### 新闻快讯 {#lv-dong-xin-wen-kuai-xun} - - - | 快讯 | 文章 | - | :-------: | :-----: | - | newsflash | article | - - ## 論盡媒體 AllAboutMacau Media {#lun-jin-mei-ti-allaboutmacau-media} ### 话题 {#lun-jin-mei-ti-allaboutmacau-media-hua-ti}