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 #764 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
9 changed files
with
124 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const got = require('@/utils/got'); | ||
const cheerio = require('cheerio'); | ||
const { parseItem } = require('./utils'); | ||
|
||
module.exports = async (ctx) => { | ||
const type = ctx.params.type === 'week' ? 1 : 0; | ||
const baseUrl = `https://www.gelonghui.com`; | ||
const { data: response } = await got(baseUrl); | ||
const $ = cheerio.load(response); | ||
|
||
const list = $('#hot-article ul') | ||
.eq(type) | ||
.find('li') | ||
.toArray() | ||
.map((item) => { | ||
item = $(item); | ||
const a = item.find('a'); | ||
return { | ||
title: a.text(), | ||
link: `${baseUrl}${a.attr('href')}`, | ||
}; | ||
}); | ||
|
||
const items = await Promise.all(list.map((item) => parseItem(item, ctx.cache.tryGet))); | ||
|
||
ctx.state.data = { | ||
title: `最热文章 - ${type === 0 ? '日排行' : '周排行'} - 格隆汇`, | ||
description: '格隆汇为中国投资者出海投资及中国公司出海融资,提供海外投资,港股开户行情,科创板股票发行数据、资讯、研究、交易等一站式服务,目前业务范围主要涉及港股与美股两大市场,未来将陆续开通台湾、日本、印度、欧洲等市场.', | ||
image: 'https://cdn.gelonghui.com/static/web/www.ico.la.ico', | ||
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,31 @@ | ||
const got = require('@/utils/got'); | ||
const { parseDate } = require('@/utils/parse-date'); | ||
const { art } = require('@/utils/render'); | ||
const path = require('path'); | ||
|
||
const baseUrl = 'https://www.gelonghui.com'; | ||
|
||
module.exports = async (ctx) => { | ||
const apiUrl = `${baseUrl}/api/live-channels/all/lives/v4`; | ||
const { | ||
data: { result }, | ||
} = await got(apiUrl); | ||
|
||
const items = result.map((i) => ({ | ||
title: i.title || i.content, | ||
description: art(path.join(__dirname, 'templates/live.art'), { | ||
i, | ||
}), | ||
link: i.route, | ||
category: i.source, | ||
pubDate: parseDate(i.createTimestamp, 'X'), | ||
})); | ||
|
||
ctx.state.data = { | ||
title: '格隆汇快讯-7x24小时市场快讯-财经市场热点', | ||
description: '格隆汇快讯栏目提供外汇投资实时行情,外汇投资交易,外汇投资炒股,证券等内容,实时更新,格隆汇未来将陆续开通台湾、日本、印度、欧洲等市场.', | ||
image: 'https://cdn.gelonghui.com/static/web/www.ico.la.ico', | ||
link: `${baseUrl}/live`, | ||
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
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,8 @@ | ||
module.exports = (router) => { | ||
router.get('/home/:tag?', require('./home')); | ||
router.get('/hot-article/:type?', require('./hot-article')); | ||
router.get('/keyword/:keyword', require('./keyword')); | ||
router.get('/live', require('./live')); | ||
router.get('/subject/:id', require('./subject')); | ||
router.get('/user/:id', require('./user')); | ||
}; |
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,7 @@ | ||
{{ i.content }} | ||
{{ if i.pictures }} | ||
<br> | ||
{{ each i.pictures p }} | ||
<img src="{{ p }}"> | ||
{{ /each }} | ||
{{ /if }} |
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
ec2dd45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
rsshub-master – ./
rsshub-master-git-master-auto-bot-ty.vercel.app
rsshub-master.vercel.app
rsshub-master-auto-bot-ty.vercel.app