From 60c2ae54fff3a5d139988f53073bc28a3925b1b4 Mon Sep 17 00:00:00 2001 From: Ian Simpson Date: Wed, 8 Jul 2026 15:23:46 +1200 Subject: [PATCH 1/2] Access tokens are now optional with Meta --- src/Adapters/Facebook/OEmbed.php | 12 ++++-------- src/Adapters/Instagram/OEmbed.php | 6 +----- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/Adapters/Facebook/OEmbed.php b/src/Adapters/Facebook/OEmbed.php index d913964f..5bf19383 100644 --- a/src/Adapters/Facebook/OEmbed.php +++ b/src/Adapters/Facebook/OEmbed.php @@ -8,18 +8,14 @@ class OEmbed extends Base { - const ENDPOINT_PAGE = 'https://graph.facebook.com/v11.0/oembed_page'; - const ENDPOINT_POST = 'https://graph.facebook.com/v11.0/oembed_post'; - const ENDPOINT_VIDEO = 'https://graph.facebook.com/v11.0/oembed_video'; + const ENDPOINT_PAGE = 'https://graph.facebook.com/v25.0/oembed_page'; + const ENDPOINT_POST = 'https://graph.facebook.com/v25.0/oembed_post'; + const ENDPOINT_VIDEO = 'https://graph.facebook.com/v25.0/oembed_video'; protected function detectEndpoint(): ?UriInterface { $token = $this->extractor->getSetting('facebook:token'); - if (!is_string($token) || $token === '') { - return null; - } - $uri = $this->extractor->getUri(); if (strpos($uri->getPath(), 'login') !== false) { parse_str($uri->getQuery(), $params); @@ -28,7 +24,7 @@ protected function detectEndpoint(): ?UriInterface } } $queryParameters = $this->getOembedQueryParameters((string) $uri); - $queryParameters['access_token'] = $token; + if($token) $queryParameters['access_token'] = $token; return $this->extractor->getCrawler() ->createUri($this->getEndpointByPath($uri->getPath())) diff --git a/src/Adapters/Instagram/OEmbed.php b/src/Adapters/Instagram/OEmbed.php index a0c7bd20..9bb87b14 100644 --- a/src/Adapters/Instagram/OEmbed.php +++ b/src/Adapters/Instagram/OEmbed.php @@ -14,17 +14,13 @@ protected function detectEndpoint(): ?UriInterface { $token = $this->extractor->getSetting('instagram:token'); - if (!is_string($token) || $token === '') { - return null; - } - $uri = $this->extractor->getUri(); if (strpos($uri->getPath(), 'login') !== false) { $uri = $this->extractor->getRequest()->getUri(); } $queryParameters = $this->getOembedQueryParameters((string) $uri); - $queryParameters['access_token'] = $token; + if($token) $queryParameters['access_token'] = $token; return $this->extractor->getCrawler() ->createUri(self::ENDPOINT) From fbc2e1db199f662aa5d09512184da4a1db0dbd68 Mon Sep 17 00:00:00 2001 From: Ian Simpson Date: Wed, 8 Jul 2026 15:27:29 +1200 Subject: [PATCH 2/2] Update Instagram to v25 --- src/Adapters/Instagram/OEmbed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Adapters/Instagram/OEmbed.php b/src/Adapters/Instagram/OEmbed.php index 9bb87b14..ff7b056b 100644 --- a/src/Adapters/Instagram/OEmbed.php +++ b/src/Adapters/Instagram/OEmbed.php @@ -8,7 +8,7 @@ class OEmbed extends Base { - const ENDPOINT = 'https://graph.facebook.com/v8.0/instagram_oembed'; + const ENDPOINT = 'https://graph.facebook.com/v25.0/instagram_oembed'; protected function detectEndpoint(): ?UriInterface {