Merge branch 'master' into master

This commit is contained in:
DIYgod
2020-04-19 19:13:54 +08:00
committed by GitHub
21 changed files with 424 additions and 69 deletions
+19
View File
@@ -1659,4 +1659,23 @@
},
],
},
't.me': {
_name: 'Telegram',
'.': [
{
title: '频道',
docs: 'https://docs.rsshub.app/social-media.html#telegram',
source: '/:username',
target: '/telegram/channel/:username',
script: "({isChannel:document.querySelector('.tgme_action_button_label')})",
verification: (params) => params.isChannel,
},
{
title: '频道',
docs: 'https://docs.rsshub.app/social-media.html#telegram',
source: '/s/:username',
target: '/telegram/channel/:username',
},
],
},
});
+1 -1
View File
@@ -106,7 +106,7 @@ Only for self-hosted
### Channel
<RouteEn path="/telegram/channel/:username" example="/telegram/channel/awesomeDIYgod" :paramsDesc="['channel name']">
<RouteEn path="/telegram/channel/:username" example="/telegram/channel/awesomeDIYgod" :paramsDesc="['channel name']" radar="1">
::: tip
+6
View File
@@ -470,6 +470,12 @@ pageClass: routes
<Route author="kt286" example="/radio/2/520767" path="/radio/:channelname/:name" :paramsDesc="['频道ID, 可在对应专辑页面的 URL 中找到','节目ID,可在对应专辑页面的 URL 中找到']" supportPodcast="1"/>
## 追新番日剧站
### 更新列表
<Route author="mengx8" example="/zhuixinfan/list" path="/zhuixinfan/list" />
## 字幕库
### 字幕列表
+1 -1
View File
@@ -376,7 +376,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
### 频道
<Route author="DIYgod" example="/telegram/channel/awesomeDIYgod" path="/telegram/channel/:username" :paramsDesc="['频道 username']">
<Route author="DIYgod" example="/telegram/channel/awesomeDIYgod" path="/telegram/channel/:username" :paramsDesc="['频道 username']" radar="1">
::: tip 提示
+33
View File
@@ -4,6 +4,39 @@ pageClass: routes
# 学习
## 51VOA 美国之音
### 频道
<Route author="guhuaijin" example="/51voa/address" path="/51voa/:channel" :paramsDesc="['频道名称']"/>
| `:channel` | 对应网站栏目 |
| ----------- | -------------------------------------------- |
| standard | 常速英语(VOA Standard English ) |
| archive | 常速英语存档(VOA Standard English Archives ) |
| technology | 科技报道(Technology Report) |
| daily | 今日美国(This is America) |
| sciences | 科技报道(Science in the News) |
| health | 健康报道(Health Report) |
| education | 教育报道(Education Report) |
| economics | 经济报道(Economics Report) |
| culture | 文化艺术(American Mosaic) |
| events | 时事新闻(In the News) |
| stories | 美国故事(American Stories) |
| words | 词汇掌故(Words And Their Stories) |
| trending | 今日热点(Trending Today) |
| magazine | 新闻杂志(AS IT IS) |
| grammar | 日常语法(Everyday Grammar) |
| queries | 名师答疑(Ask a Teacher) |
| history | 美国历史(U.S. History) |
| park | 国家公园(America's National Parks) |
| president | 美国总统(America's Presidents) |
| agriculture | 农业报道(Agriculture Report) |
| exploration | 自然探索(Explorations) |
| people | 美国人物(People in America) |
| bilingual | 双语新闻(Bilingual News) |
| address | 总统演讲(President Address) |
## CTFHub Calendar
### 查询国内外 CTF 赛事信息
+10
View File
@@ -24,6 +24,12 @@ pageClass: routes
<Route author="exuanbo" example="/polimi/news" path="/polimi/news/:language?" :paramsDesc="['English language code en']" />
## 安徽医科大学
### 研究生学院通知公告
<Route author="Origami404" example="/ahmu/news" path="/ahmu/news" />
## 北华航天工业学院
### 新闻
@@ -992,6 +998,10 @@ https://rsshub.app/**nuist**/`bulletin` 或 https://rsshub.app/**nuist**/`bullet
</Route>
### 清华大学招聘信息
<Route author="Halcao" example="/thu/career" path="/thu/career" />
## 山东大学
### 软件学院通知
+10
View File
@@ -591,6 +591,7 @@ router.get('/lit/xwzx/:name?', require('./routes/universities/lit/xwzx'));
router.get('/lit/tw/:name?', require('./routes/universities/lit/tw'));
// 清华大学
router.get('/thu/career', require('./routes/universities/thu/career'));
router.get('/thu/:type', require('./routes/universities/thu/index'));
// 北京大学
@@ -764,6 +765,9 @@ router.get('/ncwu/notice', require('./routes/universities/ncwu/notice'));
// 中北大学
router.get('/nuc/:type', require('./routes/universities/nuc/index'));
// 安徽医科大学研究生学院
router.get('/ahmu/news', require('./routes/universities/ahmu/news'));
// ifanr
router.get('/ifanr/:channel?', require('./routes/ifanr/index'));
@@ -2542,4 +2546,10 @@ router.get('/etoland/:bo_table', require('./routes/etoland/board'));
// 辽宁工程技术大学教务在线公告
router.get('/lntu/jwnews', require('./routes/universities/lntu/jwnews'));
// 51voa
router.get('/51voa/:channel', require('./routes/51voa/channel'));
// zhuixinfan
router.get('/zhuixinfan/list', require('./routes/zhuixinfan/list'));
module.exports = router;
+10 -14
View File
@@ -3,24 +3,20 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: `https://36kr.com/api/newsflash?per_page=30`,
url: `https://36kr.com/newsflashes`,
headers: {
'Content-Type': 'application/json; charset=utf-8',
Host: '36kr.com',
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25',
},
});
const regexp = /<script>window\.initialState=(.*?)<\/script>/;
const newsflashes = JSON.parse(response.data.match(regexp)[1]);
const newsflashes = response.data.data.items;
let newsflashesList = [];
for (let i = 0; i < newsflashes.length; i++) {
newsflashesList = newsflashesList.concat(newsflashes[i]);
}
const out = newsflashesList.map((item) => {
const date = item.published_at;
const link = item.news_url;
const title = item.title;
const description = item.description;
const out = newsflashes.newsflashList.flow.itemList.map((item) => {
const link = item.templateMaterial.sourceUrlRoute ? new URL(`http://www.example.com/${item.templateMaterial.sourceUrlRoute}`).searchParams.get('url') : `https://36kr.com/newsflashes/${item.itemId}`;
const date = item.templateMaterial.publishTime;
const title = item.templateMaterial.widgetTitle;
const description = item.templateMaterial.widgetContent;
const single = {
title,
+158
View File
@@ -0,0 +1,158 @@
const got = require('@/utils/got');
const date = require('@/utils/date');
const cheerio = require('cheerio');
const HOST = 'https://www.51voa.com';
const PAGE_ROUTER = {
standard: {
url: 'https://www.51voa.com/VOA_Standard_1.html',
title: '常速英语',
},
archive: {
url: 'https://www.51voa.com/VOA_Standard_1_archiver.html',
title: '常速英语存档',
},
technology: {
url: 'https://www.51voa.com/Technology_Report_1.html',
title: '科技报道',
},
daily: {
url: 'https://www.51voa.com/This_is_America_1.html',
title: '今日美国',
},
sciences: {
url: 'https://www.51voa.com/Science_in_the_News_1.html',
title: '科学报道',
},
health: {
url: 'https://www.51voa.com/Health_Report_1.html',
title: '健康报道',
},
education: {
url: 'https://www.51voa.com/Education_Report_1.html',
title: '教育报道',
},
economics: {
url: 'https://www.51voa.com/Economics_Report_1.html',
title: '经济报道',
},
culture: {
url: 'https://www.51voa.com/American_Mosaic_1.html',
title: '文化艺术',
},
events: {
url: 'https://www.51voa.com/In_the_News_1.html',
title: '时事新闻',
},
stories: {
url: 'https://www.51voa.com/American_Stories_1.html',
title: '美国故事',
},
words: {
url: 'https://www.51voa.com/Words_And_Their_Stories_1.html',
title: '词汇掌故',
},
trending: {
url: 'https://www.51voa.com/Trending_Today_1.html',
title: '今日热点',
},
magazine: {
url: 'https://www.51voa.com/as_it_is_1.html',
title: '新闻杂志',
},
grammar: {
url: 'https://www.51voa.com/Everyday_Grammar_1.html',
title: '日常语法',
},
queries: {
url: 'https://www.51voa.com/ask_a_teacher_1.html',
title: '名师答疑',
},
history: {
url: 'https://www.51voa.com/The_Making_of_a_Nation_1.html',
title: '美国历史',
},
park: {
url: 'https://www.51voa.com/National_Parks_1.html',
title: '国家公园',
},
president: {
url: 'https://www.51voa.com/Americas_Presidents_1.html',
title: '美国总统',
},
agriculture: {
url: 'https://www.51voa.com/Agriculture_Report_1.html',
title: '农业报道',
},
exploration: {
url: 'https://www.51voa.com/Explorations_1.html',
title: '自然探索',
},
people: {
url: 'https://www.51voa.com/People_in_America_1.html',
title: '美国人物',
},
bilingual: {
url: 'https://www.51voa.com/Bilingual_News_1.html',
title: '双语新闻',
},
address: {
url: 'https://www.51voa.com/President_Address_1.html',
title: '总统演讲',
},
};
module.exports = async (ctx) => {
const { channel } = ctx.params;
const { url, title } = PAGE_ROUTER[channel] || {};
const response = await got({
method: 'get',
url: url,
});
const $ = cheerio.load(response.data);
const list = $('div.List ul li>a')
.slice(0, 5)
.map((i, e) => $(e).attr('href'))
.get();
const out = await Promise.all(
list.map(async (link) => {
const pageUrl = HOST + link;
const cache = await ctx.cache.get(link);
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
const response = await got({
method: 'get',
url: pageUrl,
headers: {
Referer: url,
},
});
const $ = cheerio.load(response.data);
const single = {
pubDate: date($('div.Content>span.datetime').text()),
link: $('div.title h1').text(),
title: title,
description: $('div.Content').html(),
category: ['study', 'English'],
};
ctx.cache.set(link, JSON.stringify(single));
return Promise.resolve(single);
})
);
ctx.state.data = {
title: title,
link: url,
description: '51voa - ' + channel,
item: out,
};
};
+9 -3
View File
@@ -45,12 +45,18 @@ module.exports = async (ctx) => {
}
const getDes = (data) => data.desc || data.description || data.content || data.summary || (data.vest && data.vest.content) + (data.sketch && data.sketch.title) || data.intro;
const getOriginDes = (data) =>
(data && data.author && data.author.name && `转发自: @${data.author.name}: `) + (data && data.title) + (data && data.image_urls && data.image_urls.length > 0 && `<br><img src="${data.image_urls[0]}">`) ||
(data && data.apiSeasonInfo && data.apiSeasonInfo.title && `转发自: ${data.apiSeasonInfo.title}`) + (data && data.cover && `<br><img src="${data.cover}">`) ||
'';
return {
title: data.title || data.description || data.content || (data.vest && data.vest.content),
description: `${getDes(data)}${origin ? `<br><br>转发自: @${(origin.user && origin.user.uname) || (origin.owner && origin.owner.name)}: ${getDes(origin.item || origin)}` : ''}${
!disableEmbed && data.aid ? `<br><br>${utils.iframe(data.aid)}<br>` : ''
}<br>${imgHTML} `,
description: `${getDes(data)}${
origin && (origin.user || origin.owner)
? `<br><br>转发自: @${(origin.user && (origin.user.uname || origin.user.name)) || (origin.owner && origin.owner.name)}: ${getDes(origin.item || origin)}`
: `${getOriginDes(origin)}`
}${!disableEmbed && data.aid ? `<br><br>${utils.iframe(data.aid)}<br>` : ''}<br>${imgHTML} `,
pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
link: link,
};
+1 -1
View File
@@ -15,7 +15,7 @@ module.exports = async (ctx) => {
break;
case 'fagui':
channelName = '海关法规';
link = `http://www.customs.gov.cn/customs/302249/302266/08654b53-1.html`;
link = `http://www.customs.gov.cn/customs/302249/302266/index.html`;
break;
default:
break;
+11 -41
View File
@@ -3,56 +3,23 @@ const got = require('@/utils/got');
const util = require('./utils');
module.exports = async (ctx) => {
const url = `https://www.jiemian.com/lists/${ctx.params.cid}.html`;
const url = `https://a.jiemian.com/index.php?m=lists&a=ajaxNews&cid=${ctx.params.cid}&page=1`;
const res = await got.get(url);
const $ = cheerio.load(res.data);
let type, list;
let html = res.data.substring(1);
html = html.substring(0, html.length - 1);
const className = $('#load-list')[0].attribs.class;
if (className) {
switch (className) {
case 'list-view':
type = 'list';
list = $('.item-news').slice(0, 10).get();
break;
case 'list-view card':
type = 'card';
list = $('.news-view').slice(0, 10).get();
break;
default:
break;
}
}
const parsed = JSON.parse(html).rst;
const doc = cheerio.load(parsed);
const list = doc('.item-news').slice(0, 10).get();
const proList = [];
let out = await Promise.all(
list.map(async (item) => {
const $ = cheerio.load(item);
let title, itemUrl;
switch (type) {
case 'list':
title = $('.item-main a').text();
itemUrl = $('.item-main a').attr('href');
break;
case 'card':
title = $('.news-img a').attr('title');
if (!title) {
title = $('a').text();
}
itemUrl = $('.news-img a').attr('href');
break;
default:
break;
}
const title = $('.item-main a').text();
const itemUrl = $('.item-main a').attr('href');
const cache = await ctx.cache.get(itemUrl);
if (cache) {
return Promise.resolve(JSON.parse(cache));
@@ -70,6 +37,9 @@ module.exports = async (ctx) => {
out = util.ProcessFeed(out, responses);
const res2 = await got.get(`https://www.jiemian.com/lists/${ctx.params.cid}.html`);
const $ = cheerio.load(res2.data);
ctx.state.data = {
title: $('title').text(),
link: url,
+1 -1
View File
@@ -83,7 +83,7 @@ module.exports = async (ctx) => {
item = $(item);
const src = item.attr('src');
if (!src.startsWith('https://') && !src.startsWith('http://')) {
if (typeof src !== 'undefined' && !src.startsWith('https://') && !src.startsWith('http://')) {
item.attr('src', `https://bbs.pediy.com/${src}`);
}
item.attr('referrerpolicy', 'no-referrer');
+1 -1
View File
@@ -62,7 +62,7 @@ module.exports = async (ctx) => {
date_value = date_v.substring(0, date_v.length - 3);
} else {
// 文章
description = $('div.article.fmt.article__content')
description = $('article.article.fmt.article-content')
.html()
.replace(/data-src="/g, 'src="https://segmentfault.com')
.trim();
+51
View File
@@ -0,0 +1,51 @@
const got = require('@/utils/got');
const date = require('@/utils/date');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const url = 'http://yjsxy.ahmu.edu.cn/_s62/1840/list.psp';
const response = await got({ method: 'get', url });
const $ = cheerio.load(response.data);
const list = $('#wp_news_w3 table tbody')
.map((i, e) => {
const element = $(e);
const title = element.find('a').text();
const link = element.find('a').attr('href');
const dateraw = /(\d{4})\/(\d{2})(\d{2})/.exec(link);
return {
title: title,
description: '',
link: url + link,
author: '安徽医科大学研究生学院',
pubDate: date(`${dateraw[1]}-${dateraw[2]}-${dateraw[3]}`),
};
})
.get();
const result = await Promise.all(
list.map(async (item) => {
const link = item.link;
const cache = await ctx.cache.get(link);
if (cache) {
return Promise.resolve(JSON.parse(cache));
}
const itemReponse = await got.get(link);
const itemElement = cheerio.load(itemReponse.data);
item.description = itemElement('.content').html();
ctx.cache.set(link, JSON.stringify(item));
return Promise.resolve(item);
})
);
ctx.state.data = {
title: '安徽医科大学研究生学院',
link: url,
item: result,
};
};
+40
View File
@@ -0,0 +1,40 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const resolve_url = require('url').resolve;
const base_url = 'https://career.cic.tsinghua.edu.cn/';
module.exports = async (ctx) => {
const page = 1;
const route = 'xsglxt/f/jyxt/anony/xxfb';
const response = await got({
method: 'post',
url: base_url + route,
body: `pgno=${page}`,
headers: {
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'max-age=0',
'content-type': 'application/x-www-form-urlencoded',
'proxy-connection': 'keep-alive',
'upgrade-insecure-requests': '1',
},
});
const $ = cheerio.load(response.data);
const title = '招聘信息';
ctx.state.data = {
title: '清华大学 - ' + title,
link: base_url,
description: '清华大学学生职业发展指导中心 - ' + title,
item: $('#ts_div .list li')
.map((_, elem) => ({
link: resolve_url(base_url, $('a', elem).attr('ahref')),
title: $('a', elem).text(),
pubDate: new Date($('span', elem).text()).toUTCString(),
}))
.get(),
};
};
+6 -5
View File
@@ -3,18 +3,19 @@ const got = require('@/utils/got');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: 'https://api.xiaoheihe.cn/game/web/all_recommend/games/?show_type=discount&limit=20&offset=0&os_type=web&version=999.0.0',
url: 'https://api.xiaoheihe.cn/game/get_game_list_v3?sort_type=discount&limit=20&os_type=web',
});
const data = response.data.result.list;
const data = response.data.result.games;
ctx.state.data = {
title: '小黑盒 Steam 热门折扣',
link: 'https://xiaoheihe.cn/games/index',
item: data.map((item) => ({
title: (item.price.discount === item.price.lowest_discount ? '[史低] ' : '') + item.name + (item.name_en ? ' / ' + item.name_en : ''),
description: `<img src="https://steamcdn-a.akamaihd.net/steam/apps/${item.appid}/header.jpg"> <br> 原价¥${item.heybox_price.original_coin / 1000},现价¥${item.heybox_price.cost_coin / 1000},折扣力度 ${
item.heybox_price.discount
}%,${item.price.deadline_date} <br> 评分:${item.score} <br> 简介:${item.about_the_game}`,
description:
`<img src="https://steamcdn-a.akamaihd.net/steam/apps/${item.appid}/header.jpg"> <br>` +
(item.heybox_price ? ` 小黑盒: 原价¥${item.heybox_price.original_coin / 1000},现价¥${item.heybox_price.cost_coin / 1000},折扣力度 ${item.heybox_price.discount}% <br> ` : '') +
`steam: 原价¥${item.price.initial},现价¥${item.price.current},折扣力度 ${item.price.discount}% ${item.price.deadline_date}`,
link: `https://store.steampowered.com/app/${item.appid}/?l=zh&cc=cn`,
})),
};
+1 -1
View File
@@ -16,7 +16,7 @@ module.exports = async (ctx) => {
// 最终需要返回的对象
const news = {
title: item.title,
pubDate: item.date,
pubDate: item.data,
link: item.newUrl,
};
+2
View File
@@ -66,6 +66,8 @@ module.exports = async (ctx) => {
enclosure_url: enclosure_url,
enclosure_length: enclosure_length,
enclosure_type: 'audio/x-m4a',
itunes_category: album_category,
itunes_explicit: 'clean', // 内容是否为限制级
};
return Promise.resolve(resultItem);
})
+51
View File
@@ -0,0 +1,51 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const moment = require('moment');
module.exports = async (ctx) => {
const response = await got({
method: 'get',
url: `http://www.zhuixinfan.com/main.php`,
});
const data = response.data;
const $ = cheerio.load(data);
const list = [];
Array.from($('.top-list-data:not(.top-list-data-all)')).forEach((table) => {
table = $(table);
const date = table.children('caption').first().text();
table
.find('tbody')
.children('tr')
.not((i) => i === 0)
.each((i, item) => {
item = $(item);
item.attr('date', date.substr(date.indexOf('(') + 1, 6));
list.push(item);
});
});
ctx.state.data = {
title: '追新番',
link: 'http://www.zhuixinfan.com/main.php',
language: 'zh-CN',
description: '追新番日剧站',
item: list.map((item) => {
const category = item.find('td.td2 a').first().text();
const title = item.find('td.td2 a').last().text();
const description = `资源大小:${item.find('td').eq(2).text()}`;
const link = item.find('td').eq(3).children('a').first().attr('href');
const pubDate = moment(item.attr('date'), 'MM月DD号').toDate();
return {
title: title,
description: description,
category: category,
link: link,
pubDate: pubDate,
};
}),
};
};
+2
View File
@@ -35,6 +35,8 @@
{{ if $value.itunes_item_image }}<itunes:image href="{{ $value.itunes_item_image }}"/>{{ /if }}
{{ if $value.enclosure_url }}<enclosure url="{{ $value.enclosure_url }}" {{ if $value.enclosure_length }}length="{{ $value.enclosure_length }}"{{ /if }} {{ if $value.enclosure_type }}type="{{ $value.enclosure_type }}"{{ /if }} />{{ /if }}
{{ if itunes_author && $value.itunes_duration }}<itunes:duration>{{ $value.itunes_duration }}</itunes:duration> {{ /if }}
{{ if itunes_author && $value.itunes_category }}<itunes:category>{{ $value.itunes_category }}</itunes:category> {{ /if }}
{{ if itunes_author && $value.itunes_explicit }}<itunes:explicit>{{ $value.itunes_explicit }}</itunes:explicit> {{ /if }}
{{ if $value.author }}<author><![CDATA[{{ $value.author }}]]></author>{{ /if }}
{{ if typeof $value.category === 'string' }}
<category>{{ $value.category }}</category>