mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-01 09:38:04 +08:00
* feat(route):add DLNEWS * clean up * use embedded JSON * fix: docusaurus style md * add description.art and rate limit * increase the concurency * fix: fix radar docs link * docs: move to finance ---------
23 lines
832 B
JavaScript
23 lines
832 B
JavaScript
const got = require('@/utils/got');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
const baseUrl = 'https://www.dlnews.com';
|
|
const getData = async (url) => (await got.get(url).json()).content_elements;
|
|
|
|
const getList = (data) =>
|
|
data.map((value) => {
|
|
const { _id, headlines, description, publish_date, website_url, taxonomy, credits, promo_items } = value;
|
|
return {
|
|
id: _id,
|
|
title: headlines.basic,
|
|
link: `${baseUrl}${website_url}`,
|
|
description: description.basic,
|
|
author: credits.by.map((v) => v.name).join(', '),
|
|
itunes_item_image: promo_items.basic.url,
|
|
pubDate: parseDate(publish_date),
|
|
category: taxonomy.sections.map((v) => v.name).join(', '),
|
|
};
|
|
});
|
|
|
|
module.exports = { getData, getList };
|