Skip to content

Commit

Permalink
Merge pull request #370 from RedaktionsNetzwerk-Deutschland/feature/i…
Browse files Browse the repository at this point in the history
…nstagram-short-url

fix(instagram): add instagram short url pattern (instagr.am)
  • Loading branch information
oscarotero authored Jul 3, 2020
2 parents c35f948 + 702e65e commit 96aab55
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Providers/OEmbed/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
16 changes: 16 additions & 0 deletions tests/InstagramTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
);
}
}

0 comments on commit 96aab55

Please sign in to comment.