Skip to content

Commit ef69d16

Browse files
committed
removed spotify adapter and added oembed endpoint
1 parent cdd5a09 commit ef69d16

File tree

3 files changed

+24
-34
lines changed

3 files changed

+24
-34
lines changed

src/Adapters/Spotify.php

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Providers/OEmbed/Spotify.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
namespace Embed\Providers\OEmbed;
3+
4+
class Spotify extends OEmbedImplementation
5+
{
6+
/**
7+
* {@inheritdoc}
8+
*/
9+
public static function getEndPoint()
10+
{
11+
return 'https://embed.spotify.com/oembed';
12+
}
13+
14+
/**
15+
* {@inheritdoc}
16+
*/
17+
public static function getPatterns()
18+
{
19+
return ['https?://*.spotify.com/*'];
20+
}
21+
}

tests/SpotifyTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ public function testOne()
55
{
66
$info = Embed\Embed::create('http://open.spotify.com/track/7nDQMtLxu94xtlTR8bEqjU');
77

8-
$this->assertEquals($info->title, 'Faded');
8+
$this->assertEquals($info->title, 'Zhu - Faded');
99
$this->assertEquals($info->type, 'rich');
10-
$this->assertEquals($info->code, '<iframe src="https://embed.spotify.com/?uri=spotify:track:7nDQMtLxu94xtlTR8bEqjU" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:300px;height:380px;"></iframe>');
10+
$this->assertEquals($info->code, '<iframe src="https://embed.spotify.com/?uri=spotify:track:7nDQMtLxu94xtlTR8bEqjU" width="300" height="380" frameborder="0" allowtransparency="true"></iframe>');
1111
$this->assertEquals($info->providerName, 'Spotify');
12-
$this->assertEquals($info->providerUrl, 'https://spotify.com');
12+
$this->assertEquals($info->providerUrl, 'https://www.spotify.com');
1313
}
1414
}

0 commit comments

Comments
 (0)