+ 【财新网】9月26日,汽车服务平台途虎养车正式在港交所主板挂牌上市。途虎养车( 09690.HK )上市发行价为28港元/股,此前公司披露的发行价区间为28港元/股至31港元/股,即实际发行价为区间下限。当日,途虎养车收报29.5港元/股,较发行价涨5.36%,市值为239.6亿港元。 +
++ 途虎养车上市不易。途虎养车2022年1月即在港交所递表,2022年8月、2023年3月两次重新递交上市申请材料,终于在2023年8月23日通过聆讯。 +
+diff --git a/packages/readabilityjs/Readability.js b/packages/readabilityjs/Readability.js index 65de68275..2934841bd 100644 --- a/packages/readabilityjs/Readability.js +++ b/packages/readabilityjs/Readability.js @@ -76,6 +76,22 @@ const extractPublishedDateFromAuthor = (author)=> { return [authorName, null]; }; +// extract published date from url if it's in the format of yyyy/mm/dd or yyyy-mm-dd +const extractPublishedDateFromUrl = (url) => { + if (!url) return null; + + const regex = /(\d{4})(\/|-)(\d{2})(\/|-)(\d{2})/i; + const match = url.match(regex); + if (match) { + const year = parseInt(match[1], 10); + const month = parseInt(match[3], 10) - 1; // January is 0 in JavaScript Date + const day = parseInt(match[5], 10); + + return new Date(year, month, day); + } + return null; +} + /** * Public constructor. * @param {Document} doc The document to parse. @@ -3068,7 +3084,11 @@ Readability.prototype = { return null; const byline = metadata.byline || this._articleByline; - const [author, publishedAt] = extractPublishedDateFromAuthor(byline); + const [author, publishedDateFromAuthor] = extractPublishedDateFromAuthor(byline); + const publishedDate = metadata.publishedDate || + extractPublishedDateFromUrl(this._documentURI) || + publishedDateFromAuthor || + this._articlePublishedDate; this._postProcessContent(articleContent); @@ -3104,7 +3124,7 @@ Readability.prototype = { siteName: metadata.siteName, siteIcon: metadata.siteIcon, previewImage: metadata.previewImage, - publishedDate: metadata.publishedDate || publishedAt || this._articlePublishedDate, + publishedDate, language: this._getLanguage(metadata.locale || this._languageCode), }; } diff --git a/packages/readabilityjs/test/test-pages/caixin/expected-metadata.json b/packages/readabilityjs/test/test-pages/caixin/expected-metadata.json new file mode 100644 index 000000000..b974abcc2 --- /dev/null +++ b/packages/readabilityjs/test/test-pages/caixin/expected-metadata.json @@ -0,0 +1,11 @@ +{ + "title": "途虎养车港交所挂牌 腾讯为最大外部股东", + "byline": "文|财新 余聪", + "dir": null, + "excerpt": "途虎养车 腾讯国内汽车服务市场高度分散,2022年,途虎养车取得汽车服务收入115亿元,市场份额0.9%", + "siteName": "fakehost", + "previewImage": "https://img.caixin.com/2023-09-26/169572084568190_560_373.jpg", + "publishedDate": "2023-09-25T16:00:00.000Z", + "language": "English", + "readerable": true +} diff --git a/packages/readabilityjs/test/test-pages/caixin/expected.html b/packages/readabilityjs/test/test-pages/caixin/expected.html new file mode 100644 index 000000000..feb2717e5 --- /dev/null +++ b/packages/readabilityjs/test/test-pages/caixin/expected.html @@ -0,0 +1,45 @@ +
文|财新 余聪
+2023年09月26日 17:22
+ + + +
试听
国内汽车服务市场高度分散,2022年,途虎养车取得汽车服务收入115亿元,市场份额0.9%
+【财新网】9月26日,汽车服务平台途虎养车正式在港交所主板挂牌上市。途虎养车( 09690.HK )上市发行价为28港元/股,此前公司披露的发行价区间为28港元/股至31港元/股,即实际发行价为区间下限。当日,途虎养车收报29.5港元/股,较发行价涨5.36%,市值为239.6亿港元。
+途虎养车上市不易。途虎养车2022年1月即在港交所递表,2022年8月、2023年3月两次重新递交上市申请材料,终于在2023年8月23日通过聆讯。
+
登录 后获取已订阅的阅读权限
+ + + + + + +
推荐进入财新数据库,可随时查阅公司股价走势、结构人员变化等投资信息。
+责任编辑:屈运栩 | 版面编辑:刘潇(ZN028)
+
+
+
+ + 推荐进入财新数据库,可随时查阅公司股价走势、结构人员变化等投资信息。 +
++ 2023/9/26 +
++ 2023/9/25 +
++ 2023/9/26 +
+
京公网安备 11010502034662号 | 广播电视节目制作经营许可证:京第01015号 | 出版物经营许可证:第直100013号
+