From d0a4c536428599e77fdd00d3d93a1c2158ab387c Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 2 Feb 2019 10:08:59 +0100 Subject: Ignoring cancerous colorful FB texts, which won't parse --- providers/Facebook.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'providers/Facebook.php') diff --git a/providers/Facebook.php b/providers/Facebook.php index 2126189..811ba04 100644 --- a/providers/Facebook.php +++ b/providers/Facebook.php @@ -51,12 +51,14 @@ class Facebook extends \Providers\HtmlFeed { foreach ($div->find('div>span p') as $p) { $texts[] = trim(strip_tags($p->html())); } - $items[$key] = [ - 'id' => $key, - 'content' => $div->html(), - 'texts' => $texts, - 'time' => $pIns['post_context']['publish_time'] - ]; + if (count($texts)) { + $items[$key] = [ + 'id' => $key, + 'content' => $div->html(), + 'texts' => $texts, + 'time' => $pIns['post_context']['publish_time'] + ]; + } } } return array_values($items); -- cgit v1.2.3