Skip to content

Commit

Permalink
feat(route/tableau): Add route for Tableau viz of the day. (#13528)
Browse files Browse the repository at this point in the history
* Add new route tableau viz of the day

* Add radar.js for tableau viz of the day

* fix doc for tableau viz of the day

* Add screenshot into description
  • Loading branch information
KaiyoungYu authored Oct 17, 2023
1 parent 8fded43 commit ed1f70c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/v2/tableau/maintainer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
'/app/discover/viz-of-the-day': ['KaiyoungYu'],
};
11 changes: 11 additions & 0 deletions lib/v2/tableau/radar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
'tableau.com': {
_name: 'Tableau',
public: [
{
title: 'Viz of the day',
docs: 'https://docs.rsshub.app/routes/study#tableau',
},
],
},
};
3 changes: 3 additions & 0 deletions lib/v2/tableau/router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = (router) => {
router.get('/viz-of-the-day', require('./viz-of-the-day'));
};
26 changes: 26 additions & 0 deletions lib/v2/tableau/viz-of-the-day.js
Original file line number Diff line number Diff line change
@@ -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: `<div><p>${item.description}</p><img src='${item.screenshot}'></div>`,
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,
};
};
6 changes: 6 additions & 0 deletions website/docs/routes/study.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ paramsDesc={['一个整数,筛选最近的limit场比赛,默认为5']}>

<Route author="nczitzk" example="/researchgate/publications/Somsak-Panha" path="/researchgate/publications/:username" paramsDesc={['Username, can be found in URL']} puppeteer="1" anticrawler="1"/>

## Tableau {#tableau}

### Viz of the day {#tableau-viz-of-the-day}

<Route author="KaiyoungYu" example="/tableau/viz-of-the-day" path="/tableau/viz-of-the-day" radar="1" />

## The Korea Institute of Marine Law {#the-korea-institute-of-marine-law}

### Thesis {#the-korea-institute-of-marine-law-thesis}
Expand Down

0 comments on commit ed1f70c

Please sign in to comment.