summaryrefslogtreecommitdiff
path: root/providers/Facebook.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-06-13 00:47:46 +0200
committeremkael <emkael@tlen.pl>2019-06-13 00:47:46 +0200
commitb22a686ec370f2e6bc6e2a827cc3877e99d446a0 (patch)
treeb88b540ee49fee6fbec85fcc54f0b82a261eafbe /providers/Facebook.php
parentd638b1a5f102d2aa7a3b0f06f070eaf2ac1a499a (diff)
...
Diffstat (limited to 'providers/Facebook.php')
-rw-r--r--providers/Facebook.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/providers/Facebook.php b/providers/Facebook.php
index 24645c7..f42e32c 100644
--- a/providers/Facebook.php
+++ b/providers/Facebook.php
@@ -34,10 +34,12 @@ class Facebook extends \Providers\HtmlFeed {
}
foreach ($tree->find('article') as $header) {
$data = json_decode($header->attr()['data-store'], TRUE)['linkdata'];
- $data = array_filter(
- json_decode(explode('page_insights.', $data)[1], TRUE),
+ $data = json_decode(explode('page_insights.', $data)[1], TRUE);
+ $data = array_pop(array_filter(
+ $data,
function($a) { return isset($a['post_context']); }
- )['post_context'];
+ ));
+ $data = $data['post_context'];
$key = $data['story_fbid'];
$texts = [];
foreach ($header->find('p, h3') as $paragraph) {