Skip to content

Commit

Permalink
Merge pull request #651 from DIYgod/master
Browse files Browse the repository at this point in the history
[pull] master from diygod:master
  • Loading branch information
pull[bot] authored Sep 22, 2023
2 parents 5bc7bc3 + 15802cf commit b38b8d0
Show file tree
Hide file tree
Showing 33 changed files with 428 additions and 87 deletions.
5 changes: 4 additions & 1 deletion lib/v2/141ppv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ module.exports = async (ctx) => {
.map((t) => $(t).text().trim());
const magnet = item.find('a[title="Magnet torrent"]').attr('href');
const link = item.find('a[title="Download .torrent"]').attr('href');
const image = item.find('.image').attr('src');
const onErrorAttr = item.find('.image').attr('onerror');
const backupImageRegex = /this\.src='(.*?)'/;
const match = backupImageRegex.exec(onErrorAttr);
const image = match ? match[1] : item.find('.image').attr('src');

return {
title: `${id} ${size}`,
Expand Down
4 changes: 2 additions & 2 deletions lib/v2/ainvest/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ module.exports = {
'.': [
{
title: 'Latest Article',
docs: 'https://docs.rsshub.app/finance#ainvest',
docs: 'https://docs.rsshub.app/routes/finance#ainvest',
source: ['/news'],
target: '/ainvest/article',
},
{
title: 'Latest News',
docs: 'https://docs.rsshub.app/finance#ainvest',
docs: 'https://docs.rsshub.app/routes/finance#ainvest',
source: ['/news'],
target: '/ainvest/news',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/cas/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
'www.genetics': [
{
title: '遗传与生物学研究所 - 学术活动',
docs: 'https://docs.rsshub.app/university.html#zhong-guo-ke-xue-yuan',
docs: 'https://docs.rsshub.app/routes/university#zhong-guo-ke-xue-yuan',
source: ['/jixs/yg', '/'],
target: '/cas/genetics/xshd',
},
Expand Down
6 changes: 4 additions & 2 deletions lib/v2/economist/full.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const getArticleDetail = (link, ctx) =>
$('div.article-audio-player__center-tooltip').remove();
const nextData = JSON.parse($('head script[type="application/ld+json"]').first().text());

const article = ($('figure[class^=css-]').first().parent().parent().html() || '') + $('p.article__body-text').parent().html();
const figure = $('figure[class^=css-]').first().parent().parent().html() || '';
const body = $('p[data-component="paragraph"]').parent().parent().html();
const article = figure + body;
const categories = nextData.keywords?.map((k) => k);

return { article, categories };
Expand All @@ -20,7 +22,7 @@ module.exports = async (ctx) => {
const feed = await parser.parseURL(`https://www.economist.com/${endpoint}/rss.xml`);

const items = await Promise.all(
feed.items.map(async (item) => {
feed.items.slice(0, ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30).map(async (item) => {
const path = item.link.slice(item.link.lastIndexOf('/') + 1);
const isNotCollection = !/^\d{4}-\d{2}-\d{2}$/.test(path);
const itemDetails = isNotCollection ? await getArticleDetail(item.link, ctx) : null;
Expand Down
8 changes: 4 additions & 4 deletions lib/v2/finology/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ module.exports = {
insider: [
{
title: 'Bullets',
docs: 'https://docs.rsshub.app/en/routes/finance#finology-insider',
docs: 'https://docs.rsshub.app/routes/finance#finology-insider',
source: ['/bullets'],
target: '/finology/bullets',
},
{
title: 'Category',
docs: 'https://docs.rsshub.app/en/routes/finance#finology-insider',
docs: 'https://docs.rsshub.app/routes/finance#finology-insider',
source: '/:category',
target: '/finology/:category',
},
{
title: 'Most Viewed',
docs: 'https://docs.rsshub.app/en/routes/finance#finology-insider',
docs: 'https://docs.rsshub.app/routes/finance#finology-insider',
source: '/most-viewed',
target: '/finology/most-viewed/monthly',
},
{
title: 'Trending Topic',
docs: 'https://docs.rsshub.app/en/routes/finance#finology-insider',
docs: 'https://docs.rsshub.app/routes/finance#finology-insider',
source: ['/tag/:topic'],
target: '/finology/tag/:topic',
},
Expand Down
47 changes: 47 additions & 0 deletions lib/v2/gov/chongqing/sydwgkzp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');

// 重庆市事业单位公开招聘
const sydwgkzpUrl = 'https://rlsbj.cq.gov.cn/zwxx_182/sydw/';

module.exports = async (ctx) => {
const { data: response } = await got(sydwgkzpUrl);

const $ = cheerio.load(response);

// 获取所有的标题
const list = $('div.page-list .tab-item > li')
.toArray()
.map((item) => {
item = $(item);
const title = item.find('a').first();
return {
// 文章标题
title: title.text(),
// 文章链接
link: `${sydwgkzpUrl}${title.attr('href')}`,
// 文章发布日期
pubDate: parseDate(item.find('span').text()),
};
});

// 获取每个通知的具体信息
const items = await Promise.all(
list.map((item) =>
ctx.cache.tryGet(item.link, async () => {
const { data: response } = await got(item.link);
const $ = cheerio.load(response);
// 主题正文
item.description = $('div[class="view TRS_UEDITOR trs_paper_default trs_web"]').first().html();
return item;
})
)
);

ctx.state.data = {
title: '重庆市事业单位公开招聘',
link: sydwgkzpUrl,
item: items,
};
};
1 change: 1 addition & 0 deletions lib/v2/gov/maintainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module.exports = {
'/beijing/jw/tzgg': ['nczitzk'],
'/beijing/kw/:channel': ['Fatpandac'],
'/chongqing/rsks': ['Mai19930513'],
'/chongqing/sydwgkzp': ['MajexH'],
'/dianbai/:path+': ['ShuiHuo'],
'/gaozhou/:path+': ['ShuiHuo'],
'/guangdong/tqyb/sncsyjxh': ['Fatpandac'],
Expand Down
6 changes: 6 additions & 0 deletions lib/v2/gov/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ module.exports = {
source: ['/'],
target: '/gov/chongqing/rsks',
},
{
title: '重庆事业单位公开招聘',
docs: 'https://docs.rsshub.app/routes/government#chong-qing-shi-ren-min-zheng-fu',
source: ['/'],
target: '/gov/chongqing/sydwgkzp',
},
],
},
'csrc.gov.cn': {
Expand Down
1 change: 1 addition & 0 deletions lib/v2/gov/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = function (router) {
router.get('/beijing/jw/tzgg', require('./beijing/jw/tzgg'));
router.get('/beijing/kw/:channel', require('./beijing/kw/index'));
router.get('/chongqing/rsks', require('./chongqing/rsks'));
router.get('/chongqing/sydwgkzp', require('./chongqing/sydwgkzp'));
router.get(/dianbai(\/[\w/-]+)?/, require('./dianbai/dianbai'));
router.get(/gaozhou(\/[\w/-]+)?/, require('./gaozhou/gaozhou'));
router.get('/guangdong/tqyb/sncsyjxh', require('./guangdong/tqyb/sncsyjxh'));
Expand Down
8 changes: 4 additions & 4 deletions lib/v2/grist/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ module.exports = {
'.': [
{
title: 'Articles',
docs: 'https://docs.rsshub.app/en/routes/new-media#grist',
docs: 'https://docs.rsshub.app/routes/new-media#grist',
source: ['/articles/'],
target: '/grist/',
},
{
title: 'Featured',
docs: 'https://docs.rsshub.app/en/routes/new-media#grist',
docs: 'https://docs.rsshub.app/routes/new-media#grist',
source: '/',
target: '/grist/featured',
},
{
title: 'Series',
docs: 'https://docs.rsshub.app/en/routes/new-media#grist',
docs: 'https://docs.rsshub.app/routes/new-media#grist',
source: '/series/:series',
target: '/grist/series/:series',
},
{
title: 'Topic',
docs: 'https://docs.rsshub.app/en/routes/new-media#grist',
docs: 'https://docs.rsshub.app/routes/new-media#grist',
source: ['/:topic'],
target: '/grist/topic/:topic',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/icbc/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'.': [
{
title: '外汇牌价',
docs: 'https://docs.rsshub.app/other#zhong-guo-gong-shang-yin-hang',
docs: 'https://docs.rsshub.app/routes/other#zhong-guo-gong-shang-yin-hang',
source: ['/column/1438058341489590354.html'],
target: '/icbc/whpj',
},
Expand Down
12 changes: 6 additions & 6 deletions lib/v2/liulinblog/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'.': [
{
title: '频道',
docs: 'https://docs.rsshub.app/new-media.html#mu-mu-bo-ke',
docs: 'https://docs.rsshub.app/routes/new-media#mu-mu-bo-ke',
source: ['/:channel', '/'],
target: (params, url) => {
url = new URL(url);
Expand All @@ -15,31 +15,31 @@ module.exports = {
},
{
title: '标签',
docs: 'https://docs.rsshub.app/new-media.html#mu-mu-bo-ke',
docs: 'https://docs.rsshub.app/routes/new-media#mu-mu-bo-ke',
source: ['/tag/:id', '/'],
target: '/liulinblog/tag/:id',
},
{
title: '专题',
docs: 'https://docs.rsshub.app/new-media.html#mu-mu-bo-ke',
docs: 'https://docs.rsshub.app/routes/new-media#mu-mu-bo-ke',
source: ['/series/:id', '/'],
target: '/liulinblog/series/:id',
},
{
title: '搜索',
docs: 'https://docs.rsshub.app/new-media.html#mu-mu-bo-ke',
docs: 'https://docs.rsshub.app/routes/new-media#mu-mu-bo-ke',
source: ['/search/:keyword', '/'],
target: '/liulinblog/search/:keyword',
},
{
title: '60秒读懂世界',
docs: 'https://docs.rsshub.app/new-media.html#mu-mu-bo-ke',
docs: 'https://docs.rsshub.app/routes/new-media#mu-mu-bo-ke',
source: ['/kuaixun', '/'],
target: '/liulinblog/kuaixun',
},
{
title: '网络营销',
docs: 'https://docs.rsshub.app/new-media.html#mu-mu-bo-ke',
docs: 'https://docs.rsshub.app/routes/new-media#mu-mu-bo-ke',
source: ['/:channel', '/'],
target: (params, url) => {
url = new URL(url);
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/lsnu/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'.': [
{
title: '教学部通知公告',
docs: 'https://docs.rsshub.app/university.html#le-shan-shi-fan-xue-yuan',
docs: 'https://docs.rsshub.app/routes/university#le-shan-shi-fan-xue-yuan',
source: ['/'],
target: '/lsnu/jiaowc/tzgg',
},
Expand Down
6 changes: 3 additions & 3 deletions lib/v2/niaogebiji/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ module.exports = {
'.': [
{
title: '首页',
docs: 'https://docs.rsshub.app/new-media#niao-ge-bi-ji',
docs: 'https://docs.rsshub.app/routes/new-media#niao-ge-bi-ji',
source: ['/'],
target: '/niaogebiji',
},
{
title: '今日事',
docs: 'https://docs.rsshub.app/new-media#niao-ge-bi-ji',
docs: 'https://docs.rsshub.app/routes/new-media#niao-ge-bi-ji',
source: ['/', '/bulletin'],
target: '/niaogebiji',
},
{
title: '分类目录',
docs: 'https://docs.rsshub.app/new-media#niao-ge-bi-ji',
docs: 'https://docs.rsshub.app/routes/new-media#niao-ge-bi-ji',
source: ['/cat/:cat'],
target: '/niaogebiji/cat/:cat',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/v2/oreno3d/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'.': [
{
title: '关键词搜索',
docs: 'https://docs.rsshub.app/anime.htm#an-の3dエロ-dong-hua-oreno3d-guan-jian-ci-sou-suo',
docs: 'https://docs.rsshub.app/routes/anime#an-の3dエロ-dong-hua-oreno3d-guan-jian-ci-sou-suo',
source: ['/search'],
target: (_params, url) => {
const searchParams = new URL(url).searchParams;
Expand Down
33 changes: 33 additions & 0 deletions lib/v2/sourceforge/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');

module.exports = async (ctx) => {
const routeParams = ctx.params.routeParams;

const baseURL = 'https://sourceforge.net';
const link = `https://sourceforge.net/directory/?${routeParams.toString()}`;

const response = await got.get(link);
const $ = cheerio.load(response.data);
const itemList = $('ul.projects li[itemprop=itemListElement]');

ctx.state.data = {
title: $('.content h1').text().trim(),
link,
item: itemList.toArray().map((element) => {
const item = $(element);
const title = item.find('.result-heading-title').text().trim();
const link = `${baseURL}${item.find('.result-heading-title').attr('href')}`;
const description = item.find('.result-heading-texts').html();
const pubDate = parseDate(item.find('time').attr('datetime'), 'YYYY-MM-DD');

return {
title,
link,
description,
pubDate,
};
}),
};
};
3 changes: 3 additions & 0 deletions lib/v2/sourceforge/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/:routeParams?': ['JimenezLi'],
};
12 changes: 12 additions & 0 deletions lib/v2/sourceforge/radar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
'sourceforge.net': {
_name: 'SourceForge',
www: [
{
title: 'Software',
docs: 'https://docs.rsshub.app/routes/program-update#sourceforge',
source: '/directory',
},
],
},
};
3 changes: 3 additions & 0 deletions lib/v2/sourceforge/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/:routeParams?', require('./index'));
};
2 changes: 1 addition & 1 deletion lib/v2/sqmc/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
'.': [
{
title: '官网信息',
docs: 'https://docs.rsshub.app/university.html#xin-xiang-yi-xue-yuan-san-quan-xue-yuan',
docs: 'https://docs.rsshub.app/routes/university#xin-xiang-yi-xue-yuan-san-quan-xue-yuan',
source: ['/:category/list.htm'],
target: '/sqmc/www/:category?',
},
Expand Down
Loading

1 comment on commit b38b8d0

@vercel
Copy link

@vercel vercel bot commented on b38b8d0 Sep 22, 2023

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:

zr-rsshub – ./

zr-rsshub-ming42.vercel.app
zr-rsshub.vercel.app
rss.900905.xyz
zr-rsshub-git-master-ming42.vercel.app

Please sign in to comment.