summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-02-02 10:08:59 +0100
committeremkael <emkael@tlen.pl>2019-02-02 10:08:59 +0100
commitd0a4c536428599e77fdd00d3d93a1c2158ab387c (patch)
tree56e1038f163aa54d48c929a5e119c6f48f9e23c2
parent69c7dbf359029b098892abd28e6c84ccd4004328 (diff)
Ignoring cancerous colorful FB texts, which won't parse
-rw-r--r--providers/Facebook.php14
1 files changed, 8 insertions, 6 deletions
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);