From 702e65e08c7988fc46c7532581f629ad6801ce24 Mon Sep 17 00:00:00 2001 From: reflexxion Date: Wed, 1 Jul 2020 10:57:41 +0200 Subject: [PATCH] fix(instagram): add instagram short url pattern (instagr.am) --- src/Providers/OEmbed/Instagram.php | 1 + tests/InstagramTest.php | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Providers/OEmbed/Instagram.php b/src/Providers/OEmbed/Instagram.php index 8158f998..2ac552c8 100644 --- a/src/Providers/OEmbed/Instagram.php +++ b/src/Providers/OEmbed/Instagram.php @@ -9,6 +9,7 @@ class Instagram extends EndPoint implements EndPointInterface protected static $pattern = [ 'instagram.com/p/*', 'www.instagram.com/p/*', + 'instagr.am/p/*', ]; protected static $endPoint = 'https://api.instagram.com/oembed'; diff --git a/tests/InstagramTest.php b/tests/InstagramTest.php index b34dd8d0..be61a806 100644 --- a/tests/InstagramTest.php +++ b/tests/InstagramTest.php @@ -35,4 +35,20 @@ public function testHttps() ] ); } + + public function testShortUrl() + { + $this->assertEmbed( + 'https://instagr.am/p/ySl7G9tO_q/', + [ + 'title' => 'Se va llenando el lugar donde Tsipras dará su mitin. Aún pendientes de si Syriza logra la mayoría absoluta, pero ya seguros de la victoria de la izquierda.', + 'imageWidth' => 640, + 'imageHeight' => 640, + 'type' => 'rich', + 'authorName' => 'agarzoniu', + 'authorUrl' => 'https://www.instagram.com/agarzoniu', + 'providerName' => 'Instagram', + ] + ); + } }