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 #501 from DIYgod/master
[pull] master from diygod:master
- Loading branch information
Showing
99 changed files
with
4,440 additions
and
1,767 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,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, | ||
}; | ||
}; |
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,4 @@ | ||
module.exports = { | ||
'/article': ['TonyRL'], | ||
'/news': ['TonyRL'], | ||
}; |
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,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, | ||
}; | ||
}; |
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,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', | ||
}, | ||
], | ||
}, | ||
}; |
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,4 @@ | ||
module.exports = (router) => { | ||
router.get('/article', require('./article')); | ||
router.get('/news', require('./news')); | ||
}; |
Oops, something went wrong.
195de7f
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:
rssh-hub – ./
rssh-hub-git-master-rootknight.vercel.app
rssh-hub-rootknight.vercel.app
rssh-hub-iota.vercel.app
rsshub.besalt.top