From 7c0949e5877b6e82d4e2ebc64a91948a154f5534 Mon Sep 17 00:00:00 2001 From: kik0220 <4346449+kik0220@users.noreply.github.com> Date: Tue, 16 Apr 2019 19:36:42 +0900 Subject: [PATCH] fix: add date_published selector in www.ossnews.jp extractor (#376) --- src/extractors/custom/www.ossnews.jp/index.js | 6 +++++- src/extractors/custom/www.ossnews.jp/index.test.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/extractors/custom/www.ossnews.jp/index.js b/src/extractors/custom/www.ossnews.jp/index.js index e2ffd68c6..1932f833c 100644 --- a/src/extractors/custom/www.ossnews.jp/index.js +++ b/src/extractors/custom/www.ossnews.jp/index.js @@ -7,7 +7,11 @@ export const WwwOssnewsJpExtractor = { author: null, - date_published: null, + date_published: { + selectors: ['p.fs12'], + format: 'YYYY年MM月DD日 HH:mm', + timezone: 'Asia/Tokyo', + }, dek: null, diff --git a/src/extractors/custom/www.ossnews.jp/index.test.js b/src/extractors/custom/www.ossnews.jp/index.test.js index c71a8bb8a..570a4ebb5 100644 --- a/src/extractors/custom/www.ossnews.jp/index.test.js +++ b/src/extractors/custom/www.ossnews.jp/index.test.js @@ -61,7 +61,7 @@ describe('WwwOssnewsJpExtractor', () => { // Update these values with the expected values from // the article. - assert.equal(date_published, null); + assert.equal(date_published, '2019-03-15T00:43:00.000Z'); }); it('returns the dek', async () => {