diff --git a/docs/en/journal.md b/docs/en/journal.md index 2aab9696e9..f07097bccd 100644 --- a/docs/en/journal.md +++ b/docs/en/journal.md @@ -206,10 +206,10 @@ You can get all short name of a journal from | nmat | Nature Materials | [/nature/research/nmat](https://rsshub.app/nature/research/nmat) | | natmachintell | Nature Machine Intelligence | [/nature/research/natmachintell](https://rsshub.app/nature/research/natmachintell) | -- Using router (`/nature/research/` + "short name for a journal") to query latest research paper for a certain journal of Nature Publishing Group. +- Using router (`/nature/research/` + "short name for a journal") to query latest research paper for a certain journal of Nature Publishing Group. If the `:journal` parameter is blank, then latest research of Nature will return. -- The journals from NPG are run by different group of people, and the website of may not be consitent for all the journals -- Only abstract is rendered in some researches +- The journals from NPG are run by different group of people, and the website of may not be consitent for all the journals +- Only abstract is rendered in some researches @@ -228,8 +228,8 @@ You can get all short name of a journal from | nmat | Nature Materials | [/nature/news-and-comment/nmat](https://rsshub.app/nature/news-and-comment/nmat) | | natmachintell | Nature Machine Intelligence | [/nature/news-and-https://rsshub.app/comment/natmachintell](https://rsshub.app/nature/news-and-comment/natmachintell) | -- Using router (`/nature/research/` + "short name for a journal") to query latest research paper for a certain journal of Nature Publishing Group. -- The journals from NPG are run by different group of people, and the website of may not be consitent for all the journals +- Using router (`/nature/research/` + "short name for a journal") to query latest research paper for a certain journal of Nature Publishing Group. +- The journals from NPG are run by different group of people, and the website of may not be consitent for all the journals @@ -277,7 +277,7 @@ Only some journals are supported. -- Using router (`/pnas/` + Topic of Interest) to query latest research paper for a certain topic from PNAS journal. +- Using router (`/pnas/` + Topic of Interest) to query latest research paper for a certain topic from PNAS journal. If the `:topic` parameter is blank, or equal to 'latest', then all the latest papers will return. @@ -300,41 +300,41 @@ In -## Science Journal +## Science Magazine ### Current Issue - + -| `:journal` | Full Name of the Journal | Route | +| Short name | Full name of the journal | Route | | :--------: | :----------------------------: | ---------------------------------------------------------------------------------- | -| science | Science | [/sciencemag/current/science](https://rsshub.app/sciencemag/current/science) | -| advances | Science Advances | [/sciencemag/current/advances](https://rsshub.app/sciencemag/current/advances) | -| immunology | Science Immunology | [/sciencemag/current/immunology](https://rsshub.app/sciencemag/current/immunology) | -| robotics | Science Robotics | [/sciencemag/current/robotics](https://rsshub.app/sciencemag/current/robotics) | -| stke | Science Signaling | [/sciencemag/current/stke](https://rsshub.app/sciencemag/current/stke) | -| stm | Science Translational Medicine | [/sciencemag/current/stm](https://rsshub.app/sciencemag/current/stm) | +| science | Science | [/science/current/science](https://rsshub.app/science/current/science) | +| sciadv | Science Advances | [/science/current/sciadv](https://rsshub.app/science/current/sciadv) | +| sciimmunol | Science Immunology | [/science/current/sciimmunol](https://rsshub.app/science/current/sciimmunol) | +| scirobotics | Science Robotics | [/science/current/scirobotics](https://rsshub.app/science/current/scirobotics) | +| signaling | Science Signaling | [/science/current/signaling](https://rsshub.app/science/current/signaling) | +| stm | Science Translational Medicine | [/science/current/stm](https://rsshub.app/science/current/stm) | -- Using router (`/sciencemag/current/` + “short name for a journal”) to query current issue of a journal form AAAS. - leave the parameter blank(`/sciencemag/current`)to get update from Science. +- Using route (`/science/current/` + "short name for a journal") to get current issue of a journal from AAAS. +- Leaving it empty (`/science/current`) to get update from Science. ### Cover Story - + -Subscribe to the cover images of the Science journals, and get the latest publication updates in time. +Subscribe to the cover images of Science journals, and get the latest publication updates in time. -Including ‘Science’, 'Science Advances', 'Science Immunology', 'Science Robotics', 'Science Signaling' and 'Science Translational Medicine'. +Including 'Science', 'Science Advances', 'Science Immunology', 'Science Robotics', 'Science Signaling' and 'Science Translational Medicine'. ### First Release - + -_only support Science Journal_ +*only Science, Science Immunology and Science Translational Medicine have first release* diff --git a/docs/journal.md b/docs/journal.md index 21be08aeae..4acf91d5b7 100644 --- a/docs/journal.md +++ b/docs/journal.md @@ -271,37 +271,37 @@ You can get all short name of a journal from ### 本期刊物 - + -| `:journal` | 期刊名 | 路由 | -| :--------: | :----------------------------: | ---------------------------------------------------------------------------------- | -| science | Science | [/sciencemag/current/science](https://rsshub.app/sciencemag/current/science) | -| advances | Science Advances | [/sciencemag/current/advances](https://rsshub.app/sciencemag/current/advances) | -| immunology | Science Immunology | [/sciencemag/current/immunology](https://rsshub.app/sciencemag/current/immunology) | -| robotics | Science Robotics | [/sciencemag/current/robotics](https://rsshub.app/sciencemag/current/robotics) | -| stke | Science Signaling | [/sciencemag/current/stke](https://rsshub.app/sciencemag/current/stke) | -| stm | Science Translational Medicine | [/sciencemag/current/stm](https://rsshub.app/sciencemag/current/stm) | +| 简写 | 期刊名 | 路由 | +| :---------: | :----------------------------: | ------------------------------------------------------------------------------ | +| science | Science | [/science/current/science](https://rsshub.app/science/current/science) | +| sciadv | Science Advances | [/science/current/sciadv](https://rsshub.app/science/current/sciadv) | +| sciimmunol | Science Immunology | [/science/current/sciimmunol](https://rsshub.app/science/current/sciimmunol) | +| scirobotics | Science Robotics | [/science/current/scirobotics](https://rsshub.app/science/current/scirobotics) | +| signaling | Science Signaling | [/science/current/signaling](https://rsshub.app/science/current/signaling) | +| stm | Science Translational Medicine | [/science/current/stm](https://rsshub.app/science/current/stm) | -- 通过 `/sciencemag/current/` + “杂志简写” 来获取对应杂志最新一期的文章(Current Issue)。 - 若参数置空(`/sciencemag/current`),则默认获取主刊(Science)的最新文章。 +- 通过 `/science/current/` + "期刊名简写" 来获取对应杂志最新一期的文章(Current Issue)。 + 若参数置空(`/science/current`),则默认获取主刊(Science)的最新文章。 ### 封面故事 - + 订阅 Science 系列杂志的封面图片,并及时获取刊物更新状态。 -包含了: ‘Science’, 'Science Advances', 'Science Immunology', 'Science Robotics', 'Science Signaling' 和 'Science Translational Medicine'。 +包含了: 'Science', 'Science Advances', 'Science Immunology', 'Science Robotics', 'Science Signaling' 和 'Science Translational Medicine'。 -### 主刊 - 在线发表 +### 在线发表 - + -*仅支持 Science 主刊* +*仅 Science, Science Immunology 和 Science Translational Medicine 提供在线发表* diff --git a/lib/router.js b/lib/router.js index 81329ec7e2..96550d7a61 100644 --- a/lib/router.js +++ b/lib/router.js @@ -2186,9 +2186,9 @@ router.get('/cell/cover', lazyloadRouteHandler('./routes/cell/cover')); // router.get('/nature/highlight/:year?', lazyloadRouteHandler('./routes/nature/highlight')); // science [Sci Journal] -router.get('/sciencemag/current/:journal?', lazyloadRouteHandler('./routes/sciencemag/current')); -router.get('/sciencemag/cover', lazyloadRouteHandler('./routes/sciencemag/cover')); -router.get('/sciencemag/early/science', lazyloadRouteHandler('./routes/sciencemag/early')); +// router.get('/sciencemag/current/:journal?', lazyloadRouteHandler('./routes/sciencemag/current')); +// router.get('/sciencemag/cover', lazyloadRouteHandler('./routes/sciencemag/cover')); +// router.get('/sciencemag/early/science', lazyloadRouteHandler('./routes/sciencemag/early')); // dlsite router.get('/dlsite/new/:type', lazyloadRouteHandler('./routes/dlsite/new')); diff --git a/lib/routes/sciencemag/cover.js b/lib/routes/sciencemag/cover.js deleted file mode 100644 index e4d8b67ccf..0000000000 --- a/lib/routes/sciencemag/cover.js +++ /dev/null @@ -1,56 +0,0 @@ -// journals form AAAS publishing group -// -// science: Science -// advances: Science Advances -// immunology: Science Immunology -// robotics: Science Robotics -// stke: Science Signaling -// stm: Science Translational Medicine - -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const pageURL = 'https://www.sciencemag.org/journals'; - - const pageResponse = await got.get(pageURL); - const $ = cheerio.load(pageResponse.data); - - const items = $('[class^="view-highwire-blocks-hw-"]') - .map((_, elem) => { - // eg, www.sciencemag.org/sites/default/files/styles/240x300__4_3_/public/highwire/covers/scitransmed/12/532/-F1.medium.gif?itok=aOwRMF-8 - const { id, vol, no } = $('div.media__icon > a > img', elem) - .attr('src') - .match(/\/covers\/(?\w+)\/(?\d+)\/(?\d+)\//).groups; - const url = $('div.media__body > ul > li > a', elem) - .filter((_, el) => $(el).text() === 'Current Issue') - .attr('href') - .replace(/^http:/, 'https:') - .replace(/\/$/, ''); - const name = $('div.media__body > h2', elem).text(); - const date = $('div.media__body > p > span', elem).text(); - - // eg, https://advances.sciencemag.org/content/6/8 - const address = `${url}/content/${vol}/${no}`; - // eg, https://immunology.sciencemag.org/content/immunology/5/44/F1.medium.gif - const imageURL = `${url}/content/${id}/${vol}/${no}/F1.medium.gif`; - const contents = `
Vol. ${vol} No. ${no}
`; - - return { - title: `${name} | Vol. ${vol} No. ${no}`, - author: '@yech1990', - description: contents, - link: address, - guid: address, - pubDate: new Date(date).toUTCString(), - }; - }) - .get(); - - ctx.state.data = { - title: 'Science Covers Story', - description: 'Find out the cover story of some Science journals.', - link: pageURL, - item: items, - }; -}; diff --git a/lib/routes/sciencemag/current.js b/lib/routes/sciencemag/current.js deleted file mode 100644 index ca2144c8d0..0000000000 --- a/lib/routes/sciencemag/current.js +++ /dev/null @@ -1,123 +0,0 @@ -// journals form AAAS publishing group -// -// science: Science -// advances: Science Advances -// immunology: Science Immunology -// robotics: Science Robotics -// stke: Science Signaling -// stm: Science Translational Medicine - -const cheerio = require('cheerio'); -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const journal = ctx.params.journal || 'science'; - const baseURL = `https://${journal}.sciencemag.org`; - - const pageURL = baseURL; - const pageResponse = await got.get(pageURL); - const pageCapture = cheerio.load(pageResponse.data); - - const pageTitleName = pageCapture('head > title').text() || `Science (${journal})`; - - // just select paper relative sections - const sectionList = ['research-articles', 'review', 'reports']; - - const list = [].concat.apply( - [], - sectionList.map((section) => { - const sectionContent = pageCapture(`ul > li.issue-toc-section.issue-toc-section-${section}`).html(); - if (sectionContent !== null) { - const sec = cheerio.load(sectionContent); - const sectionName = sec('h2').text(); - const sectionList = sec('ul > li > div > div > article > div').append(`
${sectionName}
`).get(); - return sectionList; - } - return []; - }) - ); - - const out = await Promise.all( - list.map(async (item) => { - const $ = cheerio.load(item); - - const title = $('h3').text(); - const partial = $('h3 > a').attr('href'); - const address = `${baseURL}${partial}`; - const section = $('div .toc-section-type').text(); - - let author; - const authorList = $('span.highwire-citation-authors > span.highwire-citation-author') - .map((_, el) => $(el).text()) - .get(); - if (authorList.length > 5) { - author = authorList.slice(0, 5).join(', ') + ' et al.'; - } else { - author = authorList.join(', '); - } - - const time = new Date($('p.highwire-cite-metadata > time').text()).toUTCString(); - - const cache = await ctx.cache.get(address); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - // contents - // section content - let sectionContents = ''; - if (section !== '') { - sectionContents = ` -
- ${section} -
- `; - } - // brief content - const brief = $('div.highwire-cite-snippet > div > div > p').text(); - let briefContents = ''; - if (brief !== '') { - briefContents = ` -
-

${brief}

-
- `; - } - const itemPage = await got.get(address); - const itemCapture = cheerio.load(itemPage.data); - - const abs = itemCapture('div > div.article > div.section') - .map((_, el) => $(el).html()) - .get() - .join('
'); - - // abs content - let absContents = ''; - if (abs !== null) { - absContents = ` -
- ${abs} -
- `; - } - const contents = sectionContents + briefContents + absContents; - - const single = { - title, - author, - description: contents, - link: address, - guid: address, - pubDate: time, - }; - ctx.cache.set(address, JSON.stringify(single)); - return Promise.resolve(single); - }) - ); - ctx.state.data = { - title: `${pageTitleName} | Current Issue`, - description: `Current Issue of ${pageTitleName}`, - link: baseURL, - item: out, - }; -}; diff --git a/lib/routes/sciencemag/early.js b/lib/routes/sciencemag/early.js deleted file mode 100644 index 2f86cc6322..0000000000 --- a/lib/routes/sciencemag/early.js +++ /dev/null @@ -1,97 +0,0 @@ -// only support Science journal - -const cheerio = require('cheerio'); -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const base = `https://science.sciencemag.org/content/early/recent`; - - const res = await got.get(base); - const pageCapture = cheerio.load(res.data); - - const list = pageCapture('ul > li > div > article > div').get(); - - const out = await Promise.all( - list.map(async (item) => { - const $ = cheerio.load(item); - - const title = $('h3').text(); - const partial = $('h3 > a').attr('href'); - const address = `${base}${partial}`; - - let author; - const authorList = $('span.highwire-citation-authors > span.highwire-citation-author') - .map((i, el) => $(el).text()) - .get(); - if (authorList.length > 5) { - author = authorList.slice(0, 5).join(', ') + ' et al.'; - } else { - author = authorList.join(', '); - } - - const time = new Date($('p.highwire-cite-metadata > time').text()).toUTCString(); - - const cache = await ctx.cache.get(address); - if (cache) { - return Promise.resolve(JSON.parse(cache)); - } - - // contents - // brief content - const brief = $('div.highwire-cite-snippet > div > div > p').text(); - let briefContents = ''; - if (brief !== '') { - briefContents = ` -
-

${brief}

-
- `; - } - - const itemPage = await got.get(address); - const itemCapture = cheerio.load(itemPage.data); - // section content - const section = itemCapture('header > div.overline').text(); - let sectionContents = ''; - if (section !== '') { - sectionContents = ` -
- ${section} - [Published Online] -
- `; - } - // abs content - const abs = itemCapture('div > div.abstract-view > div.section') - .map((i, el) => $(el).html()) - .get() - .join('
'); - let absContents = ''; - if (abs !== null) { - absContents = ` -
- ${abs} -
- `; - } - const contents = sectionContents + briefContents + absContents; - - const single = { - title, - author, - description: contents, - link: address, - guid: address, - pubDate: time, - }; - ctx.cache.set(address, JSON.stringify(single)); - return Promise.resolve(single); - }) - ); - ctx.state.data = { - title: `Science | First Release`, - description: `Science, a research journal. For papers that published online.`, - link: base, - item: out, - }; -}; diff --git a/lib/v2/science/cover.js b/lib/v2/science/cover.js new file mode 100644 index 0000000000..afc33e22fa --- /dev/null +++ b/lib/v2/science/cover.js @@ -0,0 +1,69 @@ +// journals form AAAS publishing group +// +// science: Science +// sciadv: Science Advances +// sciimmunol: Science Immunology +// scirobotics: Science Robotics +// signaling: Science Signaling +// stm: Science Translational Medicine + +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); +const { baseUrl } = require('./utils'); + +module.exports = async (ctx) => { + const pageURL = `${baseUrl}/journals`; + + const { data: pageResponse } = await got(pageURL, { + headers: { + cookie: 'cookiePolicy=iaccept;', + }, + }); + const $ = cheerio.load(pageResponse); + + const items = $('.browse-journals .browse-journals__item') + .not('.partner-journals') + .toArray() + .map((item) => { + item = $(item); + const name = item.find('.row h2').first().text().trim(); + const volume = item + .find('.row li') + .eq(0) + .text() + .trim() + .match(/Volume (\d+)/)[1]; + const issue = item + .find('.row li') + .eq(1) + .text() + .trim() + .match(/Issue (\d+)/)[1]; + const date = item.find('.row li').eq(2).text().trim(); + const coverUrl = `${baseUrl}${item.find('.cover-image__popup-moving-cover').attr('data-cover-src')}`; + const content = $('.cover-image__popup-view__caption-wrapper').html(); + const link = $('.browse-journals__item__links a').eq(0).attr('href').replace('/current', ''); + + return { + title: `${name} | Volume ${volume} Issue ${issue}`, + description: art(path.join(__dirname, 'templates/cover.art'), { + coverUrl, + content, + }), + link: `${baseUrl}/${link}/${volume}/${issue}`, + pubDate: parseDate(date), + }; + }); + + ctx.state.data = { + title: $('head title').text(), + description: $('meta[property="og:description"]').attr('content'), + image: `${baseUrl}/apple-touch-icon.png`, + link: pageURL, + language: 'en-US', + item: items, + }; +}; diff --git a/lib/v2/science/current.js b/lib/v2/science/current.js new file mode 100644 index 0000000000..57956f2f1d --- /dev/null +++ b/lib/v2/science/current.js @@ -0,0 +1,41 @@ +// journals form AAAS publishing group +// +// science: Science +// sciadv: Science Advances +// sciimmunol: Science Immunology +// scirobotics: Science Robotics +// signaling: Science Signaling +// stm: Science Translational Medicine + +const cheerio = require('cheerio'); +const got = require('@/utils/got'); +const { baseUrl, fetchDesc, getItem } = require('./utils'); + +module.exports = async (ctx) => { + const { journal = 'science' } = ctx.params; + const pageURL = `${baseUrl}/toc/${journal}/current`; + + const { data: pageResponse } = await got(pageURL, { + headers: { + cookie: 'cookiePolicy=iaccept;', + }, + }); + const $ = cheerio.load(pageResponse); + const pageTitleName = $('head > title').text(); + + const list = $('.toc__section .card') + .toArray() + .map((item) => getItem(item, $)); + + const browser = await require('@/utils/puppeteer')(); + const items = await fetchDesc(list, browser, ctx.cache.tryGet); + await browser.close(); + + ctx.state.data = { + title: `${pageTitleName} | Current Issue`, + description: `Current Issue of ${pageTitleName}`, + image: `${baseUrl}/apple-touch-icon.png`, + link: pageURL, + item: items, + }; +}; diff --git a/lib/v2/science/early.js b/lib/v2/science/early.js new file mode 100644 index 0000000000..8a031c26eb --- /dev/null +++ b/lib/v2/science/early.js @@ -0,0 +1,33 @@ +const cheerio = require('cheerio'); +const got = require('@/utils/got'); + +const { baseUrl, fetchDesc, getItem } = require('./utils'); + +module.exports = async (ctx) => { + const { journal = 'science' } = ctx.params; + const pageUrl = `${baseUrl}/toc/${journal}/0/0`; + + const { data: res } = await got(pageUrl, { + headers: { + cookie: 'cookiePolicy=iaccept;', + }, + }); + const $ = cheerio.load(res); + + const list = $('.card-content .card-header') + .toArray() + .map((item) => getItem(item, $)); + + const browser = await require('@/utils/puppeteer')(); + const items = await fetchDesc(list, browser, ctx.cache.tryGet); + await browser.close(); + + ctx.state.data = { + title: $('head title').text(), + description: $('.body02').text().trim(), + image: `${baseUrl}/apple-touch-icon.png`, + link: pageUrl, + language: 'en-US', + item: items, + }; +}; diff --git a/lib/v2/science/maintainer.js b/lib/v2/science/maintainer.js new file mode 100644 index 0000000000..7f0a84a6c2 --- /dev/null +++ b/lib/v2/science/maintainer.js @@ -0,0 +1,5 @@ +module.exports = { + '/cover': ['yech1990', 'TonyRL'], + '/current/:journal?': ['yech1990', 'TonyRL'], + '/early/:journal?': ['yech1990', 'TonyRL'], +}; diff --git a/lib/v2/science/radar.js b/lib/v2/science/radar.js new file mode 100644 index 0000000000..592e631642 --- /dev/null +++ b/lib/v2/science/radar.js @@ -0,0 +1,25 @@ +module.exports = { + 'science.org': { + _name: 'Science Magazine', + '.': [ + { + title: '本期刊物', + docs: 'https://docs-rsshub.pages.dev/journal.html#science-xi-lie', + source: ['/journal/:journal', '/toc/:journal/current'], + target: '/science/current/:journal', + }, + { + title: '封面故事', + docs: 'https://docs-rsshub.pages.dev/journal.html#science-xi-lie', + source: ['/'], + target: '/science/cover', + }, + { + title: '在线发表', + docs: 'https://docs-rsshub.pages.dev/journal.html#science-xi-lie', + source: ['/journal/:journal', '/toc/:journal/0/0'], + target: '/science/early/:journal', + }, + ], + }, +}; diff --git a/lib/v2/science/router.js b/lib/v2/science/router.js new file mode 100644 index 0000000000..15014fb337 --- /dev/null +++ b/lib/v2/science/router.js @@ -0,0 +1,5 @@ +module.exports = (router) => { + router.get('/cover', require('./cover')); + router.get('/current/:journal?', require('./current')); + router.get('/early/:journal?', require('./early')); +}; diff --git a/lib/v2/science/templates/article.art b/lib/v2/science/templates/article.art new file mode 100644 index 0000000000..5ae8004574 --- /dev/null +++ b/lib/v2/science/templates/article.art @@ -0,0 +1,2 @@ +{{ if abs }}{{@ abs }}{{ /if }} +{{ if content }}
{{@ content }}{{ /if }} diff --git a/lib/v2/science/templates/cover.art b/lib/v2/science/templates/cover.art new file mode 100644 index 0000000000..80f4e05e94 --- /dev/null +++ b/lib/v2/science/templates/cover.art @@ -0,0 +1,2 @@ + +{{@ content }} diff --git a/lib/v2/science/utils.js b/lib/v2/science/utils.js new file mode 100644 index 0000000000..94901be108 --- /dev/null +++ b/lib/v2/science/utils.js @@ -0,0 +1,64 @@ +const cheerio = require('cheerio'); +const { art } = require('@/utils/render'); +const path = require('path'); +const { parseDate } = require('@/utils/parse-date'); + +const baseUrl = 'https://www.science.org'; + +const fetchDesc = (list, browser, tryGet) => + Promise.all( + list.map((item) => + tryGet(item.link, async () => { + const page = await browser.newPage(); + await page.setRequestInterception(true); + page.on('request', (request) => { + request.resourceType() === 'document' || request.resourceType() === 'script' ? request.continue() : request.abort(); + }); + + await page.goto(item.link, { + waitUntil: 'domcontentloaded', + }); + await page.waitForSelector('section#frontmatter, .news-article-content, .news-article-content--featured'); + const res = await page.evaluate(() => document.documentElement.innerHTML); + await page.close(); + + const $ = cheerio.load(res); + const abstract = $('div#abstracts').html(); + const content = $('.news-article-content--featured').length + ? $('.news-article-content--featured').html() + : $('.news-article-content').length + ? $('.news-article-content').html() + : $('.info-panel__formats a.btn__request-access').length + ? '' + : $('section#bodymatter').html(); + + item.description = art(path.join(__dirname, 'templates/article.art'), { + abs: abstract, + content, + }); + + return item; + }) + ) + ); + +const getItem = (item, $) => { + item = $(item); + return { + title: item.find('.article-title a').attr('title'), + link: `${baseUrl}${item.find('.article-title a').attr('href')}`, + doi: item.find('.article-title a').attr('href').replace('/doi/', ''), + pubDate: parseDate(item.find('.card-meta__item time').text()), + author: item + .find('.card-meta ul[title="list of authors"] li') + .toArray() + .map((author) => $(author).text()) + .join(', '), + }; +}; + +module.exports = { + baseUrl, + fetchDesc, + getItem, +};