Skip to content

Commit 40b218d

Browse files
committed
Add support for SassMeister (implements #49)
1 parent bea61aa commit 40b218d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/Adapters/Sassmeister.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/**
4+
* Adapter to generate embed code from SassMeister.
5+
*/
6+
namespace Embed\Adapters;
7+
8+
use Embed\Request;
9+
use Embed\Utils;
10+
11+
class Sassmeister extends Webpage implements AdapterInterface
12+
{
13+
/**
14+
* {@inheritdoc}
15+
*/
16+
public static function check(Request $request)
17+
{
18+
return $request->isValid() && $request->match([
19+
'http://sassmeister.com/gist/*',
20+
]);
21+
}
22+
23+
/**
24+
* {@inheritdoc}
25+
*/
26+
public function getCode()
27+
{
28+
$id = $this->request->getDirectoryPosition(1);
29+
30+
return Utils::iframe("http://embed.sassmeister.com/gist/{$id}");
31+
}
32+
}

0 commit comments

Comments
 (0)