Skip to content

feat(route): add 荣鼎咨询 #18618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions lib/routes/rhg/blog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Route, ViewType } from '@/types';
import ofetch from '@/utils/ofetch';
import { load } from 'cheerio';

export const route: Route = {
path: '/blog',
categories: ['new-media'],
view: ViewType.Articles,
example: '/rhg/blog',
url: 'rhg.com',
name: 'Articles',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Route name does not match the RSS content.

maintainers: ['xnum'],
radar: [
{
title: 'China',
source: ['rhg.com/'],
},
],
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
handler,
};

async function handler() {
const rootUrl = 'https://rhg.com/china/research';
const response = await ofetch(rootUrl);
const $ = load(response);
const items = $('.c-listing__list .c-card')
.toArray()
.map((item) => {
const $item = $(item);
const title = $item.find('.c-card__title').text();
const link = $item.find('.c-card__link').attr('href');
const description = $item.find('.c-card__description').text();
return {
title,
link,
description,
};
});
return {
title: '荣鼎咨询-China',
link: rootUrl,
item: items,
};
}
7 changes: 7 additions & 0 deletions lib/routes/rhg/namespace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Namespace } from '@/types';

export const namespace: Namespace = {
name: '荣鼎咨询',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: '荣鼎咨询',
name: 'Rhodium Group',

url: 'rhg.com',
description: '荣鼎咨询研究报告',
Comment on lines +3 to +6
Copy link
Collaborator

@TonyRL TonyRL Apr 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing lang property.

};
Loading