Skip to content

Commit c956972

Browse files
author
Younès El Biache
committed
more publishing dates metas check for HTML
1 parent 6a2f569 commit c956972

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/Providers/Html.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,30 @@ public function getHeight()
138138
*/
139139
public function getPublishedTime()
140140
{
141-
return $this->bag->get('pub_date')
142-
?: $this->bag->get('date')
143-
?: $this->bag->get('pagerender')
144-
?: $this->bag->get('datepublished');
141+
$keys = [
142+
'article:published_time',
143+
'created',
144+
'date',
145+
'date.created',
146+
'date.issued',
147+
'datepublished',
148+
'datePublished',
149+
'newsrepublic:publish_date',
150+
'pagerender',
151+
'pub_date',
152+
'publication-date',
153+
'publish-date',
154+
'rc.datecreation',
155+
'article:modified_time',
156+
'eomportal-lastupdate',
157+
'shareaholic:article_published_time',
158+
];
159+
160+
foreach ($keys as $key) {
161+
if ($found = $this->bag->get($key)) {
162+
return $found;
163+
}
164+
}
145165
}
146166

147167
/**

0 commit comments

Comments
 (0)