* Add New York Museums with working code * Add Guggenheim and fix Jewish Museum * Add pubDate for Gugg and Met Exhibitions * Update docs * Add New Museum and MCA Chicago, update document * Fix en route * Add and update radar.js * Add Brooklyn Museum * Reformat code * Update route and travel information * Fix `http` -> `https` for `radar.js` * Change some link quotations mark * Using `parseDate` provided by the project * Removing "insecureHTTPParser" * Fix JewishMuseum issue * Use regex instead of node's vm * Update lib/v2/jewishmuseum/exhibitions.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update lib/v2/guggenheim/exhibitions.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update docs/en/travel.md Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update docs/travel.md Co-authored-by: Tony <TonyRL@users.noreply.github.com> Co-authored-by: Tony <TonyRL@users.noreply.github.com>
28 lines
710 B
JavaScript
28 lines
710 B
JavaScript
const buildData = require('@/utils/common-config');
|
|
|
|
module.exports = async (ctx) => {
|
|
let link;
|
|
const state = ctx.query.state;
|
|
|
|
switch (state) {
|
|
case undefined:
|
|
case 'current':
|
|
link = 'https://www.newmuseum.org/exhibitions/';
|
|
break;
|
|
default:
|
|
link = `https://www.newmuseum.org/exhibitions/${state}`;
|
|
}
|
|
|
|
ctx.state.data = await buildData({
|
|
link,
|
|
url: link,
|
|
title: 'New Museum - Exhibitions',
|
|
item: {
|
|
item: '.exh',
|
|
title: `$('.exh .title').text()`,
|
|
link: `$('.exh > a').attr('href')`,
|
|
description: `$('.exh .body-reveal').text()`,
|
|
},
|
|
});
|
|
};
|