feat(route): Unusual Whales (#10917)

This commit is contained in:
Tony
2022-09-27 05:30:40 +08:00
committed by GitHub
parent b0e96408a8
commit b93ed91f97
6 changed files with 55 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
'/news': ['TonyRL'],
};
+24
View File
@@ -0,0 +1,24 @@
const got = require('@/utils/got');
const { parseDate } = require('@/utils/parse-date');
const apiBase = 'https://phx.unusualwhales.com';
module.exports = async (ctx) => {
const { data } = await got(`${apiBase}/api/fj_articles`);
const items = data.map((item) => ({
title: item.title,
description: item.description,
link: item.url,
pubDate: parseDate(item.publish_date),
}));
ctx.state.data = {
title: 'Flow - News',
description: 'Explore unusual options, options flow, dark pools, short activity, and stock activity on unusualwhales.com. Unusual whales has a full news service available!',
link: 'https://unusualwhales.com/news-feed',
image: 'https://unusualwhales.com/android-icon-192x192.png',
language: 'en-US',
item: items,
};
};
+13
View File
@@ -0,0 +1,13 @@
module.exports = {
'unusualwhales.com': {
_name: 'Unusual Whales',
'.': [
{
title: 'News Flow',
docs: 'https://docs.rsshub.app/en/finance.html#unusual-whales',
source: ['/news', '/'],
target: '/unusualwhales/news',
},
],
},
};
+3
View File
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/news', require('./news'));
};