diff --git a/lib/v2/tableau/maintainer.js b/lib/v2/tableau/maintainer.js new file mode 100644 index 00000000000000..0c70993a2e0c75 --- /dev/null +++ b/lib/v2/tableau/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/app/discover/viz-of-the-day': ['KaiyoungYu'], +}; diff --git a/lib/v2/tableau/radar.js b/lib/v2/tableau/radar.js new file mode 100644 index 00000000000000..6c561a00265a8c --- /dev/null +++ b/lib/v2/tableau/radar.js @@ -0,0 +1,11 @@ +module.exports = { + 'tableau.com': { + _name: 'Tableau', + public: [ + { + title: 'Viz of the day', + docs: 'https://docs.rsshub.app/routes/study#tableau', + }, + ], + }, +}; diff --git a/lib/v2/tableau/router.js b/lib/v2/tableau/router.js new file mode 100644 index 00000000000000..15d5d08c6b11ff --- /dev/null +++ b/lib/v2/tableau/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/viz-of-the-day', require('./viz-of-the-day')); +}; diff --git a/lib/v2/tableau/viz-of-the-day.js b/lib/v2/tableau/viz-of-the-day.js new file mode 100644 index 00000000000000..941cad7d4b9d9a --- /dev/null +++ b/lib/v2/tableau/viz-of-the-day.js @@ -0,0 +1,26 @@ +const got = require('@/utils/got'); +// const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + // Your logic here + const rootUrl = 'https://public.tableau.com/api/gallery?page=0&count=20&galleryType=viz-of-the-day'; + const { data: response } = await got(rootUrl); + + const items = response.items.map((item) => ({ + title: item.title, + link: item.sourceUrl, + pubDate: parseDate(item.galleryItemPublicationDate), + author: item.authorName, + description: `

${item.description}

`, + itunes_item_image: item.screenshot, + })); + + ctx.state.data = { + // Your RSS output here + title: 'Tableau Viz of the Day', + link: 'https://public.tableau.com/app/discover/viz-of-the-day', + image: 'https://help.tableau.com/current/pro/desktop/en-us/Resources/tableau-logo.png', + item: items, + }; +}; diff --git a/website/docs/routes/study.md b/website/docs/routes/study.md index d8b4d946dd9104..4ee9b01bcee6db 100644 --- a/website/docs/routes/study.md +++ b/website/docs/routes/study.md @@ -284,6 +284,12 @@ paramsDesc={['一个整数,筛选最近的limit场比赛,默认为5']}> +## Tableau {#tableau} + +### Viz of the day {#tableau-viz-of-the-day} + + + ## The Korea Institute of Marine Law {#the-korea-institute-of-marine-law} ### Thesis {#the-korea-institute-of-marine-law-thesis}