Skip to content

Commit 920737e

Browse files
committed
Added support for reddit #261
1 parent e87e148 commit 920737e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/Providers/OEmbed/Reddit.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
namespace Embed\Providers\OEmbed;
4+
5+
class Reddit extends EndPoint implements EndPointInterface
6+
{
7+
protected static $pattern = 'www.reddit.com/*';
8+
protected static $endPoint = 'https://www.reddit.com/oembed';
9+
}

tests/RedditTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Embed\Tests;
4+
5+
class RedditTest extends AbstractTestCase
6+
{
7+
public function testOne()
8+
{
9+
$this->assertEmbed(
10+
'https://www.reddit.com/r/investing/comments/7pfpeq/buffett_on_cyrptocurrencies_i_can_say_almost_with/',
11+
[
12+
'title' => "Buffett on cyrptocurrencies: 'I can say almost with certainty that they will come to a bad ending'",
13+
'type' => 'rich',
14+
'authorName' => 'dennisrieves',
15+
'providerName' => 'reddit',
16+
]
17+
);
18+
}
19+
}

0 commit comments

Comments
 (0)