| @@ 138-148 (lines=11) @@ | ||
| 135 | $nodes = $this->article()->getRawDoc()->find('*[name="dc.date"], *[name="dc.date.issued"], *[name="DC.date.issued"]'); |
|
| 136 | ||
| 137 | /* @var $node Element */ |
|
| 138 | foreach ($nodes as $node) { |
|
| 139 | try { |
|
| 140 | if ($node->hasAttribute('content')) { |
|
| 141 | $dt = new \DateTime($node->getAttribute('content')); |
|
| 142 | break; |
|
| 143 | } |
|
| 144 | } |
|
| 145 | catch (\Exception $e) { |
|
| 146 | // Do nothing here in case the node has unrecognizable date information. |
|
| 147 | } |
|
| 148 | } |
|
| 149 | ||
| 150 | if (!is_null($dt)) { |
|
| 151 | return $dt; |
|
| @@ 224-234 (lines=11) @@ | ||
| 221 | $nodes = $this->article()->getRawDoc()->find('meta[name="parsely-pub-date"]'); |
|
| 222 | ||
| 223 | /* @var $node Element */ |
|
| 224 | foreach ($nodes as $node) { |
|
| 225 | try { |
|
| 226 | if ($node->hasAttribute('content')) { |
|
| 227 | $dt = new \DateTime($node->getAttribute('content')); |
|
| 228 | break; |
|
| 229 | } |
|
| 230 | } |
|
| 231 | catch (\Exception $e) { |
|
| 232 | // Do nothing here in case the node has unrecognizable date information. |
|
| 233 | } |
|
| 234 | } |
|
| 235 | ||
| 236 | if (!is_null($dt)) { |
|
| 237 | return $dt; |
|