Fix timestamp decoding

This commit is contained in:
teromene 2018-11-04 21:50:18 +01:00
parent 07b4c72d5d
commit b55ec51e0e
1 changed files with 5 additions and 2 deletions

View File

@ -95,7 +95,8 @@ EOD;
foreach($html->find('article') as $content) { foreach($html->find('article') as $content) {
$item = array(); $item = array();
preg_match('/publish_time\\\":([0-9]+),/', $content->getAttribute('data-store', 0), $match); //echo $content; die();
preg_match('/publish_time\\\":([0-9]+),/', $content->getAttribute('data-store', 0), $match);
if(isset($match[1])) if(isset($match[1]))
$timestamp = $match[1]; $timestamp = $match[1];
else else
@ -205,7 +206,9 @@ EOD;
$regex = '/\\"html\\":(\".+\/div>"),"replace/'; $regex = '/\\"html\\":(\".+\/div>"),"replace/';
preg_match($regex, $pageContent, $result); preg_match($regex, $pageContent, $result);
$htmlContent = html_entity_decode(json_decode($result[1]), ENT_QUOTES, 'UTF-8'); $htmlContent = json_decode($result[1]);
$htmlContent = preg_replace('/(?<!style)="(.*?)"/', '=\'$1\'', $htmlContent);
$htmlContent = html_entity_decode($htmlContent, ENT_QUOTES, 'UTF-8');
return str_get_html($htmlContent); return str_get_html($htmlContent);
} }