From efe32aad2290dbd1866370678261cbf825a83279 Mon Sep 17 00:00:00 2001 From: Joshua Coales Date: Fri, 6 Nov 2020 13:43:10 +0000 Subject: [PATCH] [FacebookBridge] Permalink fix (#1838) Also removing timestamp which does not work --- bridges/FacebookBridge.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/bridges/FacebookBridge.php b/bridges/FacebookBridge.php index bb9d02eb..c03de4ed 100644 --- a/bridges/FacebookBridge.php +++ b/bridges/FacebookBridge.php @@ -203,7 +203,6 @@ class FacebookBridge extends BridgeAbstract { $item['title'] = $this->extractGroupPostTitle($post); $item['author'] = $this->extractGroupPostAuthor($post); $item['content'] = $this->extractGroupPostContent($post); - $item['timestamp'] = $this->extractGroupPostTimestamp($post); $item['enclosures'] = $this->extractGroupPostEnclosures($post); $this->items[] = $item; @@ -282,7 +281,8 @@ class FacebookBridge extends BridgeAbstract { // Find the one that is a permalink if(strpos($anchor->href, 'permalink') !== false) { - return $anchor->href; + $arr = explode('?', $anchor->href, 2); + return $arr[0]; } } @@ -304,15 +304,6 @@ class FacebookBridge extends BridgeAbstract { } - private function extractGroupPostTimestamp($post) { - - $element = $post->find('abbr', 0) - or returnServerError('Unable to find timestamp!'); - - return $element->plaintext; - - } - private function extractGroupPostAuthor($post) { $element = $post->find('h3 a', 0)