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 #1325 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
11 changed files
with
250 additions
and
211 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 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,69 @@ | ||
import { Data, DataItem, Route } from '@/types'; | ||
import got from '@/utils/got'; | ||
import { parseDate } from '@/utils/parse-date'; | ||
import { load } from 'cheerio'; | ||
import { Context } from 'hono'; | ||
|
||
export const route: Route = { | ||
path: '/:category?/:tab?', | ||
categories: ['game'], | ||
example: '/2023game/sgame/topicList', | ||
parameters: { | ||
category: '分类,见下表', | ||
tab: '标签, 所有:all;最新:topicList;热门:jhcpb', | ||
}, | ||
features: { | ||
requireConfig: false, | ||
requirePuppeteer: false, | ||
antiCrawler: false, | ||
supportBT: false, | ||
supportPodcast: false, | ||
supportScihub: false, | ||
}, | ||
name: '游戏星辰', | ||
maintainers: ['xzzpig'], | ||
handler, | ||
url: 'www.2023game.com/', | ||
description: `分类 | ||
| PS4游戏 | switch游戏 | 3DS游戏 | PSV游戏 | Xbox360 | PS3游戏 | 世嘉MD/SS | PSP游戏 | PC周边 | 怀旧掌机 | 怀旧主机 | PS4教程 | PS4金手指 | switch金手指 | switch教程 | switch补丁 | switch主题 | switch存档 | | ||
| -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | | ||
| ps4 | sgame | 3ds | psv | jiaocheng | ps3yx | zhuji.md | zhangji.psp | pcgame | zhangji | zhuji | ps4.psjc | ps41.ps4pkg | nsaita.cundang | nsaita.pojie | nsaita.buding | nsaita.zhutie | nsaita.zhuti |`, | ||
}; | ||
|
||
async function handler(ctx?: Context): Promise<Data> { | ||
const category = (ctx!.req.param('category') ?? 'sgame').replaceAll('.', '/'); | ||
const tab = ctx?.req.param('tab') ?? 'all'; | ||
|
||
const currentUrl = `https://www.2023game.com/${category}/`; | ||
|
||
const response = await got(currentUrl); | ||
const $ = load(response.data as any); | ||
|
||
let selector = `.news`; | ||
if (tab !== 'all') { | ||
selector = `#${tab} > ${selector}`; | ||
} | ||
|
||
const items: DataItem[] = $(selector) | ||
.toArray() | ||
.map((item) => { | ||
const $item = $(item); | ||
const href = $item.find('a').attr('href'); | ||
return { | ||
title: $item.text().trim(), | ||
guid: `2023game:${href}`, | ||
link: href!, | ||
pubDate: parseDate($item.find('.time_box').text().trim()), | ||
description: $item.html() ?? '', | ||
}; | ||
}); | ||
|
||
return { | ||
title: $('title').text(), | ||
link: currentUrl, | ||
allowEmpty: true, | ||
image: 'https://www.2023game.com/resources/img/logo.png', | ||
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,6 @@ | ||
import type { Namespace } from '@/types'; | ||
|
||
export const namespace: Namespace = { | ||
name: '游戏星辰', | ||
url: 'www.2023game.com', | ||
}; |
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,66 @@ | ||
import { Route } from '@/types'; | ||
import got from '@/utils/got'; | ||
|
||
const linkUrl = 'https://book.douban.com/latest'; | ||
const baseUrl = 'https://m.douban.com/rexxar/api/v2/subject_collection'; | ||
const params = 'items?start=0&count=10&mode=collection&for_mobile=1'; | ||
|
||
export const route: Route = { | ||
path: '/book/latest/:type?', | ||
categories: ['social-media'], | ||
example: '/douban/book/latest/fiction', | ||
parameters: { type: '专题分类,可选,默认为 `all`' }, | ||
features: { | ||
requireConfig: false, | ||
requirePuppeteer: false, | ||
antiCrawler: false, | ||
supportBT: false, | ||
supportPodcast: false, | ||
supportScihub: false, | ||
}, | ||
name: '新书速递', | ||
maintainers: ['fengkx', 'lyqluis'], | ||
description: ` | ||
| 文学 | 小说 | 历史文化 | 社会纪实 | 科学新知 | 艺术设计 | 商业经管 | 绘本漫画 | | ||
| ------------ | ------- | -------- | --------- | -------- | -------- | -------- | -------- | | ||
| prose_poetry | fiction | history | biography | science | art | business | comics |`, | ||
handler, | ||
}; | ||
|
||
const SUBCATS = { | ||
all: '全部', | ||
prose_poetry: '文学', | ||
fiction: '小说', | ||
history: '历史文化', | ||
biography: '社会纪实', | ||
science: '科学新知', | ||
art: '艺术设计', | ||
business: '商业经管', | ||
comics: '绘本漫画', | ||
}; | ||
|
||
async function handler(ctx) { | ||
const type = ctx.req.param('type') ?? 'all'; | ||
const subUrl = `new_book_${type}`; | ||
const url = `${baseUrl}/${subUrl}/${params}`; | ||
|
||
const res = await got.get(url); | ||
const items = res.data.items; | ||
|
||
return { | ||
title: `豆瓣新书速递${type === 'all' ? '' : '-' + SUBCATS[type]}`, | ||
link: `${linkUrl}${type === 'all' ? '' : '?subcat=' + SUBCATS[type]}`, | ||
item: items.map(({ title, url, card_subtitle, cards, pic, rating, null_rating_reason }) => { | ||
const rate = rating.value ? `${rating.value}分` : null_rating_reason; | ||
const img = `<img src="${pic.normal}">`; | ||
const info = card_subtitle; | ||
const description = `${img}<br>${title}<br><br>${info}<br><br>${cards[0]?.content ?? ''}<br><br>${rate}`; | ||
|
||
return { | ||
title, | ||
description, | ||
link: url, | ||
}; | ||
}), | ||
}; | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.