Skip to content
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

[pull] master from diygod:master #501

Merged
merged 28 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8a3d9ad
revert: "chore(deps): bump codecov/codecov-action from 3 to 4 (#13301)"
TonyRL Sep 15, 2023
2cc8a58
feat(route): 添加gamegene的rss订阅 (#13296)
lone1y-51 Sep 15, 2023
92a376d
feat(route): add sitemap transform (#13297)
flrngel Sep 15, 2023
ad99b02
style: auto format
github-actions[bot] Sep 15, 2023
49db618
chore(deps-dev): bump @types/jsdom from 21.1.2 to 21.1.3 (#13314)
dependabot[bot] Sep 16, 2023
9f76883
chore(deps-dev): bump @types/json-bigint from 1.0.1 to 1.0.2 (#13313)
dependabot[bot] Sep 16, 2023
0d0f482
fix(route): update mixcloud queries (#13319)
Misaka13514 Sep 16, 2023
5d5f63d
feat(route): 华南理工大学 - 机械与汽车工程学院 (#13310)
Ermaotie Sep 16, 2023
aba9c21
feat: /sqmc/www 新乡医学院三全学院官网信息 (#13322)
nyaShine Sep 16, 2023
b9604ca
feat(route): add alternativeto.net (#13320)
JimenezLi Sep 16, 2023
70f884e
feat(route): add 快科技 (#13312)
nczitzk Sep 17, 2023
e30cbac
fix(route/cbc): Fix article content html tag (#13325)
wb14123 Sep 17, 2023
8cc729b
chore(deps-dev): bump @tsconfig/docusaurus in /website (#13333)
dependabot[bot] Sep 18, 2023
bc75193
feat(route): add 厦门理工大学教务处 (#13326)
icecliffs Sep 19, 2023
d4d8df1
style: auto format
github-actions[bot] Sep 19, 2023
e942224
feat(route): add Lemmy (#13327)
wb14123 Sep 19, 2023
b104925
chore(deps): bump puppeteer from 21.2.1 to 21.3.1 (#13338)
dependabot[bot] Sep 19, 2023
548770d
feat(route): add 新片场 (#13345)
nczitzk Sep 20, 2023
110622d
feat(route): add 仮面ライダ最新情報 (#13336)
nczitzk Sep 20, 2023
a79cc3d
chore(deps-dev): bump @vercel/nft from 0.23.1 to 0.24.1 (#13341)
dependabot[bot] Sep 20, 2023
75d18e9
chore(deps): bump the docs group in /website with 6 updates (#13347)
dependabot[bot] Sep 20, 2023
81e36b8
chore(deps): bump @sentry/node from 7.69.0 to 7.70.0 (#13346)
dependabot[bot] Sep 20, 2023
46d32af
feat(route): add ainvest (#13348)
TonyRL Sep 21, 2023
b08abca
fix(route): Remove duplicate articles in reuters feed. (#13349)
dzx-dzx Sep 21, 2023
6b7949a
fix(route): Refine category for udn feed. (#13351)
dzx-dzx Sep 21, 2023
cfe8569
fix(route): niaogebiji (#13354)
TonyRL Sep 21, 2023
eb1a40a
chore: fix random ua generation (#13356)
TonyRL Sep 21, 2023
217b0e9
fix(route): appstore (#13357)
TonyRL Sep 21, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
REDIS_URL: redis://localhost:${{ job.services.redis.ports[6379] }}/
- name: Upload coverage to Codecov
if: ${{ matrix.node-version == '18' }}
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos as documented, but seems broken

Expand Down
2 changes: 1 addition & 1 deletion lib/radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const toSource = require('tosource');
const { join } = require('path');

// Namespaces that do not require radar.js
const allowNamespace = ['discourse', 'discuz', 'ehentai', 'mail', 'test'];
const allowNamespace = ['discourse', 'discuz', 'ehentai', 'lemmy', 'mail', 'test'];
// Check if a radar.js file is exist under each folder of dirname
for (const dir of fs.readdirSync(dirname)) {
const dirPath = join(dirname, dir);
Expand Down
10 changes: 5 additions & 5 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ router.get('/dekudeals/:type', lazyloadRouteHandler('./routes/dekudeals'));
router.get('/metacritic/release/:platform/:type/:sort?', lazyloadRouteHandler('./routes/metacritic/release'));

// 快科技(原驱动之家)
router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news'));
// router.get('/kkj/news', lazyloadRouteHandler('./routes/kkj/news'));

// sixthtone
router.get('/sixthtone/news', lazyloadRouteHandler('./routes/sixthtone/news'));
Expand Down Expand Up @@ -1443,7 +1443,7 @@ router.get('/xinquji/today/internal', lazyloadRouteHandler('./routes/xinquji/int
router.get('/gbcc/trust', lazyloadRouteHandler('./routes/gbcc/trust'));

// CBC
router.get('/cbc/topics/:topic?', lazyloadRouteHandler('./routes/cbc/topics'));
// router.get('/cbc/topics/:topic?', lazyloadRouteHandler('./routes/cbc/topics'));

// discuz
// router.get('/discuz/:ver([7|x])/:cid([0-9]{2})/:link(.*)', lazyloadRouteHandler('./routes/discuz/discuz'));
Expand Down Expand Up @@ -1868,9 +1868,9 @@ router.get('/gov/chongqing/ljxq/zwgk/:caty', lazyloadRouteHandler('./routes/gov/
router.get('/12379', lazyloadRouteHandler('./routes/12379/index'));

// 鸟哥笔记
router.get('/ngbj', lazyloadRouteHandler('./routes/niaogebiji/index'));
router.get('/ngbj/today', lazyloadRouteHandler('./routes/niaogebiji/today'));
router.get('/ngbj/cat/:cat', lazyloadRouteHandler('./routes/niaogebiji/cat'));
// router.get('/ngbj', lazyloadRouteHandler('./routes/niaogebiji/index'));
// router.get('/ngbj/today', lazyloadRouteHandler('./routes/niaogebiji/today'));
// router.get('/ngbj/cat/:cat', lazyloadRouteHandler('./routes/niaogebiji/cat'));

// 梅花网
router.get('/meihua/shots/:caty', lazyloadRouteHandler('./routes/meihua/shots'));
Expand Down
52 changes: 0 additions & 52 deletions lib/routes/kkj/news.js

This file was deleted.

86 changes: 0 additions & 86 deletions lib/routes/niaogebiji/cat.js

This file was deleted.

40 changes: 0 additions & 40 deletions lib/routes/niaogebiji/index.js

This file was deleted.

29 changes: 0 additions & 29 deletions lib/routes/niaogebiji/today.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/utils/rand-user-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = ({ browser = 'chrome', os = 'mac os', device = 'desktop' }) =>
let UA = randUserAgent(device, browser, os);

if (browser === 'chrome') {
while (UA.includes('Chrome-Lighthouse') || UA.includes('Gener8') || UA.includes('HeadlessChrome') || UA.includes('SMTBot')) {
while (UA.includes('Chrome-Lighthouse') || UA.includes('Gener8') || UA.includes('HeadlessChrome') || UA.includes('SMTBot') || UA.includes('Electron') || UA.includes('Code')) {
UA = randUserAgent(device, browser, os);
}
}
Expand Down
42 changes: 42 additions & 0 deletions lib/v2/ainvest/article.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const { getHeaders, randomString, encryptAES, decryptAES } = require('./utils');

module.exports = async (ctx) => {
const key = randomString(16);

const { data: response } = await got.post('https://api.ainvest.com/gw/socialcenter/v1/edu/article/listArticle', {
headers: getHeaders(key),
searchParams: {
timestamp: Date.now(),
},
data: encryptAES(
JSON.stringify({
batch: ctx.query.limit ? parseInt(ctx.query.limit, 10) : 30,
startId: null,
tags: {
in: ['markettrends', 'premarket', 'companyinsights', 'macro'],
and: ['web', 'creationplatform'],
},
}),
key
),
});

const { data } = JSON.parse(decryptAES(response, key));

const items = data.map((item) => ({
title: item.title,
description: item.content,
link: item.sourceUrl,
pubDate: parseDate(item.postDate, 'x'),
category: [item.nickName, ...item.tags.map((tag) => tag.code)],
}));

ctx.state.data = {
title: 'AInvest - Latest Articles',
link: 'https://www.ainvest.com/news',
language: 'en',
item: items,
};
};
4 changes: 4 additions & 0 deletions lib/v2/ainvest/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'/article': ['TonyRL'],
'/news': ['TonyRL'],
};
39 changes: 39 additions & 0 deletions lib/v2/ainvest/news.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const { getHeaders, randomString, decryptAES } = require('./utils');

module.exports = async (ctx) => {
const key = randomString(16);

const { data: response } = await got('https://api.ainvest.com/gw/news_f10/v1/newsFlash/getNewsData', {
headers: getHeaders(key),
searchParams: {
terminal: 'web',
tab: 'all',
page: 1,
size: ctx.query.limit ? parseInt(ctx.query.limit, 10) : 50,
lastId: '',
timestamp: Date.now(),
},
});

const { data } = JSON.parse(decryptAES(response, key));

const items = data.content.map((item) => ({
title: item.title,
description: item.content,
link: item.sourceUrl,
pubDate: parseDate(item.publishTime, 'x'),
category: item.tagList.map((tag) => tag.nameEn),
author: item.userInfo.nickname,
upvotes: item.likeCount,
comments: item.commentCount,
}));

ctx.state.data = {
title: 'AInvest - Latest News',
link: 'https://www.ainvest.com/news',
language: 'en',
item: items,
};
};
19 changes: 19 additions & 0 deletions lib/v2/ainvest/radar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
'ainvest.com': {
_name: 'AInvest',
'.': [
{
title: 'Latest Article',
docs: 'https://docs.rsshub.app/finance#ainvest',
source: ['/news'],
target: '/ainvest/article',
},
{
title: 'Latest News',
docs: 'https://docs.rsshub.app/finance#ainvest',
source: ['/news'],
target: '/ainvest/news',
},
],
},
};
4 changes: 4 additions & 0 deletions lib/v2/ainvest/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = (router) => {
router.get('/article', require('./article'));
router.get('/news', require('./news'));
};
Loading