From 779c1154fbedef644926c3e23289806df58bc196 Mon Sep 17 00:00:00 2001 From: kik0220 <4346449+kik0220@users.noreply.github.com> Date: Tue, 16 Apr 2019 19:46:24 +0900 Subject: [PATCH] fix: add date_published selector in www.sanwa.co.jp extractor (#378) --- src/extractors/custom/www.sanwa.co.jp/index.js | 6 +++++- src/extractors/custom/www.sanwa.co.jp/index.test.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/extractors/custom/www.sanwa.co.jp/index.js b/src/extractors/custom/www.sanwa.co.jp/index.js index 1a221d6e5..af3276c35 100644 --- a/src/extractors/custom/www.sanwa.co.jp/index.js +++ b/src/extractors/custom/www.sanwa.co.jp/index.js @@ -7,7 +7,11 @@ export const WwwSanwaCoJpExtractor = { author: null, - date_published: null, + date_published: { + selectors: ['p.date'], + format: 'YYYY.MM.DD', + timezone: 'Asia/Tokyo', + }, dek: { selectors: [['meta[name="og:description"]', 'value']], diff --git a/src/extractors/custom/www.sanwa.co.jp/index.test.js b/src/extractors/custom/www.sanwa.co.jp/index.test.js index cc47ca20f..33936edfd 100644 --- a/src/extractors/custom/www.sanwa.co.jp/index.test.js +++ b/src/extractors/custom/www.sanwa.co.jp/index.test.js @@ -58,7 +58,7 @@ describe('WwwSanwaCoJpExtractor', () => { // Update these values with the expected values from // the article. - assert.equal(date_published, null); + assert.equal(date_published, '2019-03-07T15:00:00.000Z'); }); it('returns the dek', async () => {