Skip to content

Commit

Permalink
Merge pull request #145 from KrohnMi/facebook-page-url
Browse files Browse the repository at this point in the history
[TASK]: Get post url direct from the facebook api
  • Loading branch information
MattiasNilsson authored Dec 23, 2022
2 parents 036f90b + c7b0223 commit 2225daf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions Classes/Feed/Source/FacebookSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected function getEndPointFields(): array
'reactions.summary(true).limit(0)',
'message',
'attachments',
'permalink_url',
'created_time',
'updated_time',
];
Expand Down
3 changes: 1 addition & 2 deletions Classes/Feed/Update/FacebookFeedUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ protected function createFeedItem(array $rawData, Configuration $configuration):
{
$feedItem = $this->objectManager->get(Feed::class);

list($userId, $postId) = GeneralUtility::trimExplode('_', $rawData['id'], true);
$feedItem->setPostUrl('https://facebook.com/' . $userId . '/posts/' . $postId);
$feedItem->setPostUrl($rawData['permalink_url']);
$feedItem->setPostDate(\DateTime::createFromFormat(\DateTime::ISO8601, $rawData['created_time']));
$feedItem->setConfiguration($configuration);
$feedItem->setExternalIdentifier($rawData['id']);
Expand Down

0 comments on commit 2225daf

Please sign in to comment.