File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
use Embed \Request ;
9
9
use Embed \Providers ;
10
+ use Embed \Utils ;
10
11
11
12
class N500px extends Adapter implements AdapterInterface
12
13
{
14
+
13
15
/**
14
16
* {@inheritdoc}
15
17
*/
@@ -19,6 +21,22 @@ public static function check(Request $request)
19
21
'https?://500px.com/photo/* ' ,
20
22
]);;
21
23
}
24
+
25
+
26
+ /**
27
+ * {@inheritdoc}
28
+ */
29
+ public function getCode ()
30
+ {
31
+ $ url =$ this ->getUrl ();
32
+ $ matches =array ();
33
+ preg_match ('#(https?://500px.com/photo/\d+)#si ' ,$ this ->getUrl (),$ matches );
34
+ if (isset ($ matches [1 ]) && $ matches [1 ]) {
35
+ return Utils::iframe ($ matches [1 ].'/embed.html ' , $ this ->getWidth (), $ this ->getHeight ());
36
+ }
37
+ return '' ;
38
+ }
39
+
22
40
23
41
/**
24
42
* {@inheritdoc}
@@ -28,5 +46,6 @@ public function run()
28
46
//order is important
29
47
$ this ->addProvider ('oembed ' , new Providers \OEmbed ());
30
48
$ this ->addProvider ('opengraph ' , new Providers \OpenGraph ());
49
+ echo $ this ->request ->getUrl ();
31
50
}
32
51
}
You can’t perform that action at this time.
0 commit comments