diff --git a/lib/XRay/Formats/Instagram.php b/lib/XRay/Formats/Instagram.php index e543a08..315480b 100644 --- a/lib/XRay/Formats/Instagram.php +++ b/lib/XRay/Formats/Instagram.php @@ -209,6 +209,9 @@ class Instagram extends Format { else $author['photo'] = $profile['profile_pic_url']; + if(isset($profile['biography'])) + $author['note'] = $profile['biography']; + return $author; } diff --git a/tests/InstagramTest.php b/tests/InstagramTest.php index 16cd215..821ca06 100644 --- a/tests/InstagramTest.php +++ b/tests/InstagramTest.php @@ -181,4 +181,21 @@ class InstagramTest extends PHPUnit_Framework_TestCase { ], $data['data']); } + public function testInstagramProfileWithBio() { + $url = 'https://www.instagram.com/pk_spam/'; + $response = $this->parse(['url' => $url]); + + $body = $response->getContent(); + $this->assertEquals(200, $response->getStatusCode()); + $data = json_decode($body, true); + + $this->assertSame([ + 'type' => 'card', + 'name' => 'pk_spam', + 'url' => 'https://aaronparecki.com/', + 'photo' => 'https://instagram.fhel2-1.fna.fbcdn.net/vp/f17e1275a70fc32e93cbf434ddc32bcd/5B6CCC7A/t51.2885-19/11906329_960233084022564_1448528159_a.jpg', + 'note' => 'My website is https://aaronparecki.com.dev/ and http://aaronpk.micro.blog/about/ and https://tiny.xyz.dev/' + ], $data['data']); + } + }