From 5431f175062363920443d1822344c69cdf00a780 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 6 May 2021 15:10:06 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E5=AE=8C=E6=88=90issues#7485,=E5=9C=A8?= =?UTF-8?q?=E6=AF=8F=E6=97=A5=E4=B8=80=E5=9B=BE-=E5=9B=BD=E5=AE=B6?= =?UTF-8?q?=E5=9C=B0=E7=90=86=E4=B8=AD=E5=A2=9E=E5=8A=A0=E6=AF=8F=E6=97=A5?= =?UTF-8?q?=E7=B2=BE=E9=80=89=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/picture.md | 4 ++++ lib/router.js | 1 + lib/routes/natgeo/dailyselection.js | 32 +++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 lib/routes/natgeo/dailyselection.js diff --git a/docs/picture.md b/docs/picture.md index 0a1b04379064aa..69357b1523f137 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -368,6 +368,10 @@ R18 显示 +### 每日精选 + + + ## 煎蛋 ### 无聊图 diff --git a/lib/router.js b/lib/router.js index bb40705959f751..949f4ea258608a 100644 --- a/lib/router.js +++ b/lib/router.js @@ -407,6 +407,7 @@ router.get('/gcores/category/:category', require('./routes/gcores/category')); // 国家地理 router.get('/natgeo/dailyphoto', require('./routes/natgeo/dailyphoto')); +router.get('/natgeo/dailyselection', require('./routes/natgeo/dailyselection')); router.get('/natgeo/:cat/:type?', require('./routes/natgeo/natgeo')); // 一个 diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js new file mode 100644 index 00000000000000..37e9def88a702b --- /dev/null +++ b/lib/routes/natgeo/dailyselection.js @@ -0,0 +1,32 @@ +const got = require('@/utils/got'); + +module.exports = async (ctx) => { + const host = 'http://dili.bdatu.com/jiekou/mains/p1.html'; + const data = await got.get(host); + + const sort = data.data.album[1].sort; + + const api = 'http://dili.bdatu.com/jiekou/albums/a' + sort + '.html'; + const response = await got.get(api); + + const items = response.data.picture; + const out = new Array; + + items.map((item) => { + const info = { + title: item.title, + link: item.url, + description: `
` + item.content, + pubDate: item.addtime, + guid: item.id, + }; + out.push(info); + return info; + }); + + ctx.state.data = { + title: 'Photo of the Daily Selection', + link: api, + item: out, + }; +}; \ No newline at end of file From c3ce5e75aa8d07dded9f8056dec8c73d7045400f Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 6 May 2021 15:57:33 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E5=92=8Crouter=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/picture.md | 8 ++++---- lib/router.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/picture.md b/docs/picture.md index 69357b1523f137..a6aba6fcf13898 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -364,14 +364,14 @@ R18 显示 ## 国家地理 -### 每日一图 - - - ### 每日精选 +### 每日一图 + + + ## 煎蛋 ### 无聊图 diff --git a/lib/router.js b/lib/router.js index 949f4ea258608a..de94a82c86752b 100644 --- a/lib/router.js +++ b/lib/router.js @@ -406,8 +406,8 @@ router.get('/sexinsex/:id/:type?', require('./routes/sexinsex/index')); router.get('/gcores/category/:category', require('./routes/gcores/category')); // 国家地理 -router.get('/natgeo/dailyphoto', require('./routes/natgeo/dailyphoto')); router.get('/natgeo/dailyselection', require('./routes/natgeo/dailyselection')); +router.get('/natgeo/dailyphoto', require('./routes/natgeo/dailyphoto')); router.get('/natgeo/:cat/:type?', require('./routes/natgeo/natgeo')); // 一个 From 3255f6376ac1a99b0e65a74fe8dfdfbd574c65a1 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Wed, 12 May 2021 16:42:10 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=AF=B9=E6=97=A5=E6=9C=9FpubDate?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E8=BF=9B=E8=A1=8C=E4=BA=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index 37e9def88a702b..c01e350a3b384f 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -1,4 +1,5 @@ const got = require('@/utils/got'); +const parseDate = require('@/utils/parse-date'); module.exports = async (ctx) => { const host = 'http://dili.bdatu.com/jiekou/mains/p1.html'; @@ -17,7 +18,7 @@ module.exports = async (ctx) => { title: item.title, link: item.url, description: `
` + item.content, - pubDate: item.addtime, + pubDate: parseDate(item.addtime,'YYYY/MM/DD'), guid: item.id, }; out.push(info); From 7fd967bcfda8d4c8b1e7ce2519753105646fad77 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 13 May 2021 14:42:44 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=86=85=E5=AE=B9=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9pubDate=E5=AD=97=E6=AE=B5=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index c01e350a3b384f..6bcf30902137a7 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -1,24 +1,34 @@ const got = require('@/utils/got'); const parseDate = require('@/utils/parse-date'); +const timezone = require('@/utils/timezone'); module.exports = async (ctx) => { const host = 'http://dili.bdatu.com/jiekou/mains/p1.html'; const data = await got.get(host); - const sort = data.data.album[1].sort; + let sort = 0; + let addtime = ''; + + for (let i = 0; i < data.data.album.length; i++) { + if(data.data.album[i].ds == 1){ + sort = data.data.album[i].sort; + addtime = data.data.album[i].addtime; + break; + } + } const api = 'http://dili.bdatu.com/jiekou/albums/a' + sort + '.html'; const response = await got.get(api); const items = response.data.picture; const out = new Array; - + items.map((item) => { const info = { title: item.title, link: item.url, description: `
` + item.content, - pubDate: parseDate(item.addtime,'YYYY/MM/DD'), + pubDate: timezone(parseDate(addtime), +0), guid: item.id, }; out.push(info); From 703ccaa7ebf864b99cb2b3d5fce03de2dd987858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=A7=E9=83=81=E7=9A=84=E7=B4=AB=E8=89=B2=E6=AF=9B?= =?UTF-8?q?=E8=A1=A3=E7=94=B7=E5=AD=A9?= Date: Sat, 15 May 2021 16:54:59 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E8=B0=83=E6=95=B4pubDate=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index 6bcf30902137a7..386e8196483eeb 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -8,27 +8,26 @@ module.exports = async (ctx) => { let sort = 0; let addtime = ''; - + console.log(data.data.album); for (let i = 0; i < data.data.album.length; i++) { - if(data.data.album[i].ds == 1){ + if (data.data.album[i].ds == 1) { sort = data.data.album[i].sort; addtime = data.data.album[i].addtime; break; } } - const api = 'http://dili.bdatu.com/jiekou/albums/a' + sort + '.html'; const response = await got.get(api); - const items = response.data.picture; const out = new Array; - + + items.map((item) => { const info = { title: item.title, link: item.url, description: `
` + item.content, - pubDate: timezone(parseDate(addtime), +0), + pubDate: timezone(parseDate(addtime), +8), guid: item.id, }; out.push(info); @@ -40,4 +39,4 @@ module.exports = async (ctx) => { link: api, item: out, }; -}; \ No newline at end of file +}; From 556db62f70a31df996ad61c0b6e6ff47794da9a1 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Mon, 17 May 2021 18:17:15 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E5=A4=9A=E4=BD=99=E7=9A=84console?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index 386e8196483eeb..11f977a0ae00c4 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -8,7 +8,7 @@ module.exports = async (ctx) => { let sort = 0; let addtime = ''; - console.log(data.data.album); + for (let i = 0; i < data.data.album.length; i++) { if (data.data.album[i].ds == 1) { sort = data.data.album[i].sort; @@ -21,7 +21,6 @@ module.exports = async (ctx) => { const items = response.data.picture; const out = new Array; - items.map((item) => { const info = { title: item.title, From 20bf6ffa2ca01dcb15d30215c39bddba5bb63364 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Mon, 17 May 2021 18:35:08 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E8=B0=83=E6=95=B4parse-date=E5=BC=95?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index 11f977a0ae00c4..5df12acbbf24f0 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -1,6 +1,8 @@ const got = require('@/utils/got'); -const parseDate = require('@/utils/parse-date'); const timezone = require('@/utils/timezone'); +const { + parseDate +} = require('@/utils/parse-date'); module.exports = async (ctx) => { const host = 'http://dili.bdatu.com/jiekou/mains/p1.html'; From e378a4bd7a4f944c31951d4796b450155cdd45e8 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Wed, 19 May 2021 14:52:50 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index 5df12acbbf24f0..ce5c5d3aaf96e4 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { let addtime = ''; for (let i = 0; i < data.data.album.length; i++) { - if (data.data.album[i].ds == 1) { + if (parseInt(data.data.album[i].ds) === 1) { sort = data.data.album[i].sort; addtime = data.data.album[i].addtime; break; @@ -28,7 +28,7 @@ module.exports = async (ctx) => { title: item.title, link: item.url, description: `
` + item.content, - pubDate: timezone(parseDate(addtime), +8), + pubDate: timezone(parseDate(addtime), +0), guid: item.id, }; out.push(info); From c38f2db2ed2f164b19ba52906dd49597e5ac41fb Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Wed, 19 May 2021 18:49:47 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BD=E5=AE=B6?= =?UTF-8?q?=E5=9C=B0=E7=90=86=E6=AF=8F=E6=97=A5=E4=B8=80=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/picture.md | 2 +- lib/routes/natgeo/dailyphoto.js | 43 ++++++++++++++++++++------------- package-lock.json | 40 ++++++++++++++++-------------- package.json | 2 +- 4 files changed, 50 insertions(+), 37 deletions(-) diff --git a/docs/picture.md b/docs/picture.md index d42855ab81dab2..1c4965ec81a1c6 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -370,7 +370,7 @@ R18 显示 ### 每日一图 - + ## 煎蛋 diff --git a/lib/routes/natgeo/dailyphoto.js b/lib/routes/natgeo/dailyphoto.js index 8e6c1695d931c2..c338f78ab00168 100644 --- a/lib/routes/natgeo/dailyphoto.js +++ b/lib/routes/natgeo/dailyphoto.js @@ -1,27 +1,36 @@ const got = require('@/utils/got'); +const cheerio = require('cheerio'); module.exports = async (ctx) => { - const today = new Date(); - const year = today.getFullYear(); - const month = today.getMonth() + 1; + const browser = await require('@/utils/puppeteer')(); + const page = await browser.newPage(); + const link = 'https://www.nationalgeographic.com/photo-of-the-day/media-spotlight/'; + await page.goto(link); + const html = await page.evaluate( + () => + document.querySelector('div.InlineGallery').innerHTML + ); + browser.close(); - const api = `https://www.nationalgeographic.com/content/photography/en_US/photo-of-the-day/_jcr_content/.gallery.${year}-${month}.json`; - const response = await got.get(api); - const items = response.data.items; + const $ = cheerio.load(html); - const out = items.slice(0, 10).map((item) => { - const info = { - title: item.image.title, - author: item.image.credit && item.image.credit.replace('Photograph by ', ''), - link: item.pageUrl, - description: `` + item.image.caption, - }; - return info; - }); + const imgUrl = $('img').attr('src'); + const title = $('p.Caption__Title').text(); + const description = $('span.RichText').text(); + const author = $('span.Caption__Credit').text(); + + const out = new Array; + + const info = { + title: title, + link: link, + description: `
` + 'Photography by: ' + author + '
' + description, + }; + out.push(info); ctx.state.data = { - title: 'Photo of the Day', - link: 'https://www.nationalgeographic.com/photography/photo-of-the-day/', + title: 'Photo Of The Day', + link: link, item: out, }; }; diff --git a/package-lock.json b/package-lock.json index bd0ae481820b7a..fa1e9e6888c237 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3009,6 +3009,7 @@ "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1" } }, @@ -4346,6 +4347,25 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + }, + "dependencies": { + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + } + } + }, "bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -13896,7 +13916,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, "requires": { "find-up": "^4.0.0" } @@ -15080,22 +15099,6 @@ "ws": "^7.2.3" }, "dependencies": { - "pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "requires": { - "find-up": "^4.0.0" - } - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "requires": { - "glob": "^7.1.3" - } - }, "ws": { "version": "7.4.5", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.5.tgz", @@ -15807,7 +15810,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -19091,6 +19093,7 @@ "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1" } }, @@ -19393,6 +19396,7 @@ "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1" } }, diff --git a/package.json b/package.json index cdea634db7dcf9..3b3a2c3040c1c3 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "parse-torrent": "9.1.3", "pidusage": "2.0.21", "plist": "3.0.2", - "puppeteer": "9.1.1", + "puppeteer": "^9.1.1", "query-string": "7.0.0", "require-all": "3.0.0", "rss-parser": "3.10.0", From 09cd83505887a64ccf67558f0f41cbf3086d645c Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 20 May 2021 13:57:45 +0800 Subject: [PATCH 10/18] =?UTF-8?q?issues-#7471=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=9B=BD=E5=AE=B6=E5=9C=B0=E7=90=86=E6=AF=8F=E6=97=A5=E4=B8=80?= =?UTF-8?q?=E5=9B=BE=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E4=B8=BA=E7=BD=91=E7=AB=99=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E4=B8=94=E7=BD=91=E7=AB=99=E5=AF=B9=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=BF=9B=E8=A1=8C=E4=BA=86=E5=A4=84=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E8=B0=83=E6=95=B4=E8=8E=B7=E5=8F=96=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/picture.md | 2 +- lib/routes/natgeo/dailyphoto.js | 43 ++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/docs/picture.md b/docs/picture.md index d42855ab81dab2..1c4965ec81a1c6 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -370,7 +370,7 @@ R18 显示 ### 每日一图 - + ## 煎蛋 diff --git a/lib/routes/natgeo/dailyphoto.js b/lib/routes/natgeo/dailyphoto.js index 8e6c1695d931c2..94275008c8c9d4 100644 --- a/lib/routes/natgeo/dailyphoto.js +++ b/lib/routes/natgeo/dailyphoto.js @@ -1,27 +1,36 @@ const got = require('@/utils/got'); +const cheerio = require('cheerio'); module.exports = async (ctx) => { - const today = new Date(); - const year = today.getFullYear(); - const month = today.getMonth() + 1; + const browser = await require('@/utils/puppeteer')(); + const page = await browser.newPage(); + const link = 'https://www.nationalgeographic.com/photo-of-the-day/media-spotlight/'; + await page.goto(link); + const html = await page.evaluate( + () => + document.querySelector('div.InlineGallery').innerHTML + ); + browser.close(); - const api = `https://www.nationalgeographic.com/content/photography/en_US/photo-of-the-day/_jcr_content/.gallery.${year}-${month}.json`; - const response = await got.get(api); - const items = response.data.items; + const $ = cheerio.load(html); - const out = items.slice(0, 10).map((item) => { - const info = { - title: item.image.title, - author: item.image.credit && item.image.credit.replace('Photograph by ', ''), - link: item.pageUrl, - description: `` + item.image.caption, - }; - return info; - }); + const imgUrl = $('img').attr('src'); + const title = $('p.Caption__Title').text(); + const description = $('span.RichText').text(); + const author = $('span.Caption__Credit').text(); + + const out = new Array; + + const info = { + title: title, + link: link, + description: `
` + 'Photography by: ' + author + '
' + description, + }; + out.push(info); ctx.state.data = { - title: 'Photo of the Day', - link: 'https://www.nationalgeographic.com/photography/photo-of-the-day/', + title: 'Photo Of The Day', + link: link, item: out, }; }; From 1db9ab4a984376cce74fb9f6847b9b538cd826ac Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 20 May 2021 18:19:53 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index ce5c5d3aaf96e4..7f51a179a38deb 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -1,4 +1,3 @@ -const got = require('@/utils/got'); const timezone = require('@/utils/timezone'); const { parseDate From 4fdd89d3f0e18570b796a00c7218f0e04b34c8dc Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 20 May 2021 18:22:08 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E9=94=99=E5=88=A0=E4=BA=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyphoto.js | 1 - lib/routes/natgeo/dailyselection.js | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/natgeo/dailyphoto.js b/lib/routes/natgeo/dailyphoto.js index 94275008c8c9d4..2b49675e36b948 100644 --- a/lib/routes/natgeo/dailyphoto.js +++ b/lib/routes/natgeo/dailyphoto.js @@ -1,4 +1,3 @@ -const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index 7f51a179a38deb..ce5c5d3aaf96e4 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -1,3 +1,4 @@ +const got = require('@/utils/got'); const timezone = require('@/utils/timezone'); const { parseDate From 288c203fae4a901c91757e2e08956057346fcd6d Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Thu, 20 May 2021 18:31:00 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=EF=BC=8C=E4=B9=8B=E5=89=8D=E6=8F=90=E4=BA=A4=E5=90=8E=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E5=A4=B1=E8=B4=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/natgeo/dailyselection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js index ce5c5d3aaf96e4..1a5bebb036d825 100644 --- a/lib/routes/natgeo/dailyselection.js +++ b/lib/routes/natgeo/dailyselection.js @@ -12,7 +12,7 @@ module.exports = async (ctx) => { let addtime = ''; for (let i = 0; i < data.data.album.length; i++) { - if (parseInt(data.data.album[i].ds) === 1) { + if (parseInt(data.data.album[i].ds) === 1) { sort = data.data.album[i].sort; addtime = data.data.album[i].addtime; break; From ec5048e287db559741a115bfd5c15ba626b319d1 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Tue, 25 May 2021 18:31:21 +0800 Subject: [PATCH 14/18] feat:add orcid works route --- lib/router.js | 3 +++ lib/routes/orcid/index.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 lib/routes/orcid/index.js diff --git a/lib/router.js b/lib/router.js index c4b7b13bc13f93..0751e983250255 100644 --- a/lib/router.js +++ b/lib/router.js @@ -4086,4 +4086,7 @@ router.get('/hugo/releases', require('./routes/hugo/releases')); // OR router.get('/or/:id?', require('./routes/or')); +//ORCID +router.get('/orcid/:id?', require('./routes/orcid')); + module.exports = router; diff --git a/lib/routes/orcid/index.js b/lib/routes/orcid/index.js new file mode 100644 index 00000000000000..80d55a32c00965 --- /dev/null +++ b/lib/routes/orcid/index.js @@ -0,0 +1,17 @@ +const got = require('@/utils/got'); +const timezone = require('@/utils/timezone'); +const parseDate = require('@/utils/parse-date'); + +module.exports = async (ctx) => { + const id = ctx.params.id || ''; + const rootUrl = 'https://orcid.org/'; + const currentUrl = `${rootUrl}${id ? `${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=2` : ''}`; + const response = await got.get(currentUrl); + + const items = response.data.groups; + const out = new Array; + + for (let i = 0; i < items.length; i++) { + console.log(items[i].works); + } +}; From 864e9c90e3bbee189b2aed64b5c9846adaf80355 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Wed, 26 May 2021 16:24:02 +0800 Subject: [PATCH 15/18] =?UTF-8?q?feat(route)=EF=BC=9Aadd=20ORCID=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96Works=EF=BC=88=E5=89=8D20=E6=9D=A1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/other.md | 3 +++ lib/routes/orcid/index.js | 43 ++++++++++++++++++++++++++++++++------- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/docs/other.md b/docs/other.md index d866ef1fd770b8..a7326227bf1af7 100644 --- a/docs/other.md +++ b/docs/other.md @@ -973,3 +973,6 @@ type 为 all 时,category 参数不支持 cost 和 free ### はてな匿名ダイアリー - 人気記事アーカイブ + +## ORCID + \ No newline at end of file diff --git a/lib/routes/orcid/index.js b/lib/routes/orcid/index.js index 80d55a32c00965..85d329cc20685b 100644 --- a/lib/routes/orcid/index.js +++ b/lib/routes/orcid/index.js @@ -1,17 +1,46 @@ const got = require('@/utils/got'); -const timezone = require('@/utils/timezone'); -const parseDate = require('@/utils/parse-date'); module.exports = async (ctx) => { const id = ctx.params.id || ''; const rootUrl = 'https://orcid.org/'; - const currentUrl = `${rootUrl}${id ? `${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=2` : ''}`; + const currentUrl = `${rootUrl}${id ? `${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=20` : ''}`; const response = await got.get(currentUrl); - + const items = response.data.groups; - const out = new Array; - + const works = new Array; + const out = new Array; + for (let i = 0; i < items.length; i++) { - console.log(items[i].works); + for (let j = 0; j < items[i].works.length; j++) { + works.push(items[i].works[j]); + } } + + works.map((work) => { + let publicationDate = `${work.publicationDate.year ? `${work.publicationDate.year}-`: ``}${work.publicationDate.month}${work.publicationDate.day ? `-${work.publicationDate.day}` : ``}`; + let Str = ''; + + for (let l = 0; l < work.workExternalIdentifiers.length; l++) { + if (work.workExternalIdentifiers[l].url) { + Str = Str + work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '(URL: ' + work.workExternalIdentifiers[l].url.value + ')
'; + } else { + Str = Str + work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '
'; + } + } + + const info = { + title: work.title.value, + link: work.url, + description: `

${work.title.value}

${work.journalTitle.value}

${publicationDate} | ${work.workType.value}
${Str}Source: ${work.sourceName}`, + guid: work.putCode.value, + }; + out.push(info); + return info; + }); + + ctx.state.data = { + title: 'ORCID Works List', + link: currentUrl, + item: out, + }; }; From a77e52f814e10c970b9a5ca444c6102b4991f501 Mon Sep 17 00:00:00 2001 From: OrangeEd1t Date: Wed, 26 May 2021 16:33:16 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E5=85=B6=E6=9B=B4=E5=8A=A0=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/router.js | 2 +- lib/routes/orcid/index.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/router.js b/lib/router.js index 0751e983250255..0bfb9760ca621d 100644 --- a/lib/router.js +++ b/lib/router.js @@ -4086,7 +4086,7 @@ router.get('/hugo/releases', require('./routes/hugo/releases')); // OR router.get('/or/:id?', require('./routes/or')); -//ORCID +// ORCID router.get('/orcid/:id?', require('./routes/orcid')); module.exports = router; diff --git a/lib/routes/orcid/index.js b/lib/routes/orcid/index.js index 85d329cc20685b..8b2dcfce7be6bc 100644 --- a/lib/routes/orcid/index.js +++ b/lib/routes/orcid/index.js @@ -8,7 +8,7 @@ module.exports = async (ctx) => { const items = response.data.groups; const works = new Array; - const out = new Array; + const out = new Array; for (let i = 0; i < items.length; i++) { for (let j = 0; j < items[i].works.length; j++) { @@ -17,7 +17,6 @@ module.exports = async (ctx) => { } works.map((work) => { - let publicationDate = `${work.publicationDate.year ? `${work.publicationDate.year}-`: ``}${work.publicationDate.month}${work.publicationDate.day ? `-${work.publicationDate.day}` : ``}`; let Str = ''; for (let l = 0; l < work.workExternalIdentifiers.length; l++) { @@ -31,7 +30,7 @@ module.exports = async (ctx) => { const info = { title: work.title.value, link: work.url, - description: `

${work.title.value}

${work.journalTitle.value}

${publicationDate} | ${work.workType.value}
${Str}Source: ${work.sourceName}`, + description: `

${work.title.value}

${work.journalTitle.value}

${work.publicationDate.year ? `${work.publicationDate.year}-` : ``}${work.publicationDate.month}${work.publicationDate.day ? `-${work.publicationDate.day}` : ``} | ${work.workType.value}
${Str}Source: ${work.sourceName}`, guid: work.putCode.value, }; out.push(info); From fcd0e072fab3600b3ad878ebe7818bfbef3a8803 Mon Sep 17 00:00:00 2001 From: TonyRL Date: Sun, 20 Feb 2022 17:40:55 +0000 Subject: [PATCH 17/18] fix: remove all unnecessary changes --- docs/picture.md | 6 +--- lib/routes/natgeo/dailyphoto.js | 44 ++++++++++++----------------- lib/routes/natgeo/dailyselection.js | 43 ---------------------------- 3 files changed, 19 insertions(+), 74 deletions(-) delete mode 100644 lib/routes/natgeo/dailyselection.js diff --git a/docs/picture.md b/docs/picture.md index 6a42f990169d9f..5de6f009fc2b8a 100644 --- a/docs/picture.md +++ b/docs/picture.md @@ -445,13 +445,9 @@ R18 显示 ## 国家地理 -### 每日精选 - - - ### 每日一图 - + ## 煎蛋 diff --git a/lib/routes/natgeo/dailyphoto.js b/lib/routes/natgeo/dailyphoto.js index 2b49675e36b948..8e6c1695d931c2 100644 --- a/lib/routes/natgeo/dailyphoto.js +++ b/lib/routes/natgeo/dailyphoto.js @@ -1,35 +1,27 @@ -const cheerio = require('cheerio'); +const got = require('@/utils/got'); module.exports = async (ctx) => { - const browser = await require('@/utils/puppeteer')(); - const page = await browser.newPage(); - const link = 'https://www.nationalgeographic.com/photo-of-the-day/media-spotlight/'; - await page.goto(link); - const html = await page.evaluate( - () => - document.querySelector('div.InlineGallery').innerHTML - ); - browser.close(); + const today = new Date(); + const year = today.getFullYear(); + const month = today.getMonth() + 1; - const $ = cheerio.load(html); + const api = `https://www.nationalgeographic.com/content/photography/en_US/photo-of-the-day/_jcr_content/.gallery.${year}-${month}.json`; + const response = await got.get(api); + const items = response.data.items; - const imgUrl = $('img').attr('src'); - const title = $('p.Caption__Title').text(); - const description = $('span.RichText').text(); - const author = $('span.Caption__Credit').text(); - - const out = new Array; - - const info = { - title: title, - link: link, - description: `
` + 'Photography by: ' + author + '
' + description, - }; - out.push(info); + const out = items.slice(0, 10).map((item) => { + const info = { + title: item.image.title, + author: item.image.credit && item.image.credit.replace('Photograph by ', ''), + link: item.pageUrl, + description: `` + item.image.caption, + }; + return info; + }); ctx.state.data = { - title: 'Photo Of The Day', - link: link, + title: 'Photo of the Day', + link: 'https://www.nationalgeographic.com/photography/photo-of-the-day/', item: out, }; }; diff --git a/lib/routes/natgeo/dailyselection.js b/lib/routes/natgeo/dailyselection.js deleted file mode 100644 index 1a5bebb036d825..00000000000000 --- a/lib/routes/natgeo/dailyselection.js +++ /dev/null @@ -1,43 +0,0 @@ -const got = require('@/utils/got'); -const timezone = require('@/utils/timezone'); -const { - parseDate -} = require('@/utils/parse-date'); - -module.exports = async (ctx) => { - const host = 'http://dili.bdatu.com/jiekou/mains/p1.html'; - const data = await got.get(host); - - let sort = 0; - let addtime = ''; - - for (let i = 0; i < data.data.album.length; i++) { - if (parseInt(data.data.album[i].ds) === 1) { - sort = data.data.album[i].sort; - addtime = data.data.album[i].addtime; - break; - } - } - const api = 'http://dili.bdatu.com/jiekou/albums/a' + sort + '.html'; - const response = await got.get(api); - const items = response.data.picture; - const out = new Array; - - items.map((item) => { - const info = { - title: item.title, - link: item.url, - description: `
` + item.content, - pubDate: timezone(parseDate(addtime), +0), - guid: item.id, - }; - out.push(info); - return info; - }); - - ctx.state.data = { - title: 'Photo of the Daily Selection', - link: api, - item: out, - }; -}; From 055480b989fb3c788775b76ec9cfb302941ad484 Mon Sep 17 00:00:00 2001 From: TonyRL Date: Sun, 20 Feb 2022 17:41:38 +0000 Subject: [PATCH 18/18] refactor: migrate to v2 --- docs/en/study.md | 6 +++ docs/other.md | 4 -- docs/study.md | 6 +++ lib/router.js | 7 +--- lib/routes/orcid/index.js | 45 --------------------- lib/v2/orcid/index.js | 54 ++++++++++++++++++++++++++ lib/v2/orcid/maintainer.js | 3 ++ lib/v2/orcid/radar.js | 13 +++++++ lib/v2/orcid/router.js | 3 ++ lib/v2/orcid/templates/description.art | 3 ++ 10 files changed, 90 insertions(+), 54 deletions(-) delete mode 100644 lib/routes/orcid/index.js create mode 100644 lib/v2/orcid/index.js create mode 100644 lib/v2/orcid/maintainer.js create mode 100644 lib/v2/orcid/radar.js create mode 100644 lib/v2/orcid/router.js create mode 100644 lib/v2/orcid/templates/description.art diff --git a/docs/en/study.md b/docs/en/study.md index eb9bdd20c9007d..58fc55e93a487d 100644 --- a/docs/en/study.md +++ b/docs/en/study.md @@ -48,6 +48,12 @@ pageClass: routes | columns | columns=健康 | string / undefined | | columns | columns=virus | string / undefined | +## ORCID + +### Works List + + + ## X-MOL ### News diff --git a/docs/other.md b/docs/other.md index ff51121cb6d290..ffbf40c62908ec 100644 --- a/docs/other.md +++ b/docs/other.md @@ -238,10 +238,6 @@ pageClass: routes -## ORCID - - - ## Parcel Tracking ### Hermes UK diff --git a/docs/study.md b/docs/study.md index 90852ab0e1132b..bf1a894f8e89b1 100644 --- a/docs/study.md +++ b/docs/study.md @@ -150,6 +150,12 @@ path="/ctfhub/upcoming/:limit?" +## ORCID + +### 作品列表 + + + ## ProcessOn ### 推荐 diff --git a/lib/router.js b/lib/router.js index 0113f322f2cac9..0345a7a276e611 100644 --- a/lib/router.js +++ b/lib/router.js @@ -14,7 +14,7 @@ const lazyloadRouteHandler = (routeHandlerPath) => (ctx) => { return handler(ctx); }; -// Deprecated: DO NOT ADD ROUTE HERE +// Deprecated: DO NOT ADD ANY NEW ROUTES HERE // RSSHub migrated to v2 // router.get('/rsshub/rss', lazyloadRouteHandler('./routes/rsshub/routes')); // 弃用 @@ -4176,9 +4176,6 @@ router.get('/mirror/:id', lazyloadRouteHandler('./routes/mirror/entries')); // KBS router.get('/kbs/today/:language?', lazyloadRouteHandler('./routes/kbs/today')); -// Deprecated: DO NOT ADD ROUTE HERE - -// ORCID -router.get('/orcid/:id?', require('./routes/orcid')); +// Deprecated: DO NOT ADD ANY NEWS ROUTES HERE module.exports = router; diff --git a/lib/routes/orcid/index.js b/lib/routes/orcid/index.js deleted file mode 100644 index 8b2dcfce7be6bc..00000000000000 --- a/lib/routes/orcid/index.js +++ /dev/null @@ -1,45 +0,0 @@ -const got = require('@/utils/got'); - -module.exports = async (ctx) => { - const id = ctx.params.id || ''; - const rootUrl = 'https://orcid.org/'; - const currentUrl = `${rootUrl}${id ? `${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=20` : ''}`; - const response = await got.get(currentUrl); - - const items = response.data.groups; - const works = new Array; - const out = new Array; - - for (let i = 0; i < items.length; i++) { - for (let j = 0; j < items[i].works.length; j++) { - works.push(items[i].works[j]); - } - } - - works.map((work) => { - let Str = ''; - - for (let l = 0; l < work.workExternalIdentifiers.length; l++) { - if (work.workExternalIdentifiers[l].url) { - Str = Str + work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '(URL: ' + work.workExternalIdentifiers[l].url.value + ')
'; - } else { - Str = Str + work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '
'; - } - } - - const info = { - title: work.title.value, - link: work.url, - description: `

${work.title.value}

${work.journalTitle.value}

${work.publicationDate.year ? `${work.publicationDate.year}-` : ``}${work.publicationDate.month}${work.publicationDate.day ? `-${work.publicationDate.day}` : ``} | ${work.workType.value}
${Str}Source: ${work.sourceName}`, - guid: work.putCode.value, - }; - out.push(info); - return info; - }); - - ctx.state.data = { - title: 'ORCID Works List', - link: currentUrl, - item: out, - }; -}; diff --git a/lib/v2/orcid/index.js b/lib/v2/orcid/index.js new file mode 100644 index 00000000000000..bcca5d8821500e --- /dev/null +++ b/lib/v2/orcid/index.js @@ -0,0 +1,54 @@ +const got = require('@/utils/got'); +const { art } = require('@/utils/render'); +const path = require('path'); + +module.exports = async (ctx) => { + const id = ctx.params.id; + const rootUrl = 'https://orcid.org/'; + const currentUrl = `${rootUrl}${id}/worksPage.json?offset=0&sort=date&sortAsc=false&pageSize=20`; + const response = await got(currentUrl); + + const items = response.data.groups; + const works = new Array(); + const out = new Array(); + + for (let i = 0; i < items.length; i++) { + for (let j = 0; j < items[i].works.length; j++) { + works.push(items[i].works[j]); + } + } + + works.map((work) => { + let Str = ''; + + for (let l = 0; l < work.workExternalIdentifiers.length; l++) { + if (work.workExternalIdentifiers[l].url) { + Str += '' + work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '
'; + } else { + Str += work.workExternalIdentifiers[l].externalIdentifierType.value + ': ' + work.workExternalIdentifiers[l].externalIdentifierId.value + '
'; + } + } + + const info = { + title: work.title.value, + link: work.url, + description: art(path.join(__dirname, 'templates/description.art'), { + title: work.title.value, + journalTitle: work.journalTitle.value, + publicationDate: work.publicationDate, + workType: work.workType.value, + Str, + sourceName: work.sourceName, + }), + guid: work.putCode.value, + }; + out.push(info); + return info; + }); + + ctx.state.data = { + title: 'ORCID Works List' + id, + link: currentUrl, + item: out, + }; +}; diff --git a/lib/v2/orcid/maintainer.js b/lib/v2/orcid/maintainer.js new file mode 100644 index 00000000000000..d3ae5ec3229232 --- /dev/null +++ b/lib/v2/orcid/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:id': ['OrangeEd1t'], +}; diff --git a/lib/v2/orcid/radar.js b/lib/v2/orcid/radar.js new file mode 100644 index 00000000000000..790903d7374665 --- /dev/null +++ b/lib/v2/orcid/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'orcid.org': { + _name: 'ORCID', + '.': [ + { + title: '作品列表', + docs: 'https://docs.rsshub.app/study.html#orcid', + source: ['/:id', '/'], + target: '/ocrid/:id', + }, + ], + }, +}; diff --git a/lib/v2/orcid/router.js b/lib/v2/orcid/router.js new file mode 100644 index 00000000000000..a9e414c853ee68 --- /dev/null +++ b/lib/v2/orcid/router.js @@ -0,0 +1,3 @@ +module.exports = (router) => { + router.get('/:id', require('./index')); +}; diff --git a/lib/v2/orcid/templates/description.art b/lib/v2/orcid/templates/description.art new file mode 100644 index 00000000000000..2e36ecca4464c0 --- /dev/null +++ b/lib/v2/orcid/templates/description.art @@ -0,0 +1,3 @@ +

{{ title }}

{{ journalTitle }}

+{{ if publicationDate.year }}{{ publicationDate.year }}{{ /if }}{{ if publicationDate.month }}-{{ publicationDate.month }}{{ /if }}{{ if publicationDate.day }}-{{ publicationDate.day }}{{ /if }} | {{ workType }}
+{{@ Str }}Source: {{ sourceName }} \ No newline at end of file