File tree Expand file tree Collapse file tree 3 files changed +69
-1
lines changed Expand file tree Collapse file tree 3 files changed +69
-1
lines changed Original file line number Diff line number Diff line change 1
1
The MIT License (MIT)
2
2
3
- Copyright (c) 2015 Oscar Otero Marzoa
3
+ Copyright (c) 2016 Oscar Otero Marzoa
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Embed \Adapters ;
4
+
5
+ use Embed \Utils ;
6
+ use Embed \Request ;
7
+
8
+ /**
9
+ * Adapter to get the embed code from play.cadenaser.com.
10
+ */
11
+ class Cadenaser extends Webpage implements AdapterInterface
12
+ {
13
+ /**
14
+ * {@inheritdoc}
15
+ */
16
+ public static function check (Request $ request )
17
+ {
18
+ return $ request ->isValid () && $ request ->match ([
19
+ 'https?://play.cadenaser.com/audio/* ' ,
20
+ ]);
21
+ }
22
+
23
+ /**
24
+ * {@inheritdoc}
25
+ */
26
+ public function getCode ()
27
+ {
28
+ $ url = $ this ->request ->createUrl ();
29
+ $ url = $ url ->withPath ('/widget/ ' .$ url ->getPath ());
30
+
31
+ return Utils::iframe ($ url ->getUrl (), $ this ->width , $ this ->height );
32
+ }
33
+
34
+ /**
35
+ * {@inheritdoc}
36
+ */
37
+ public function getWidth ()
38
+ {
39
+ return 620 ;
40
+ }
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ public function getHeight ()
46
+ {
47
+ return 100 ;
48
+ }
49
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ class CadenaserTest extends TestCaseBase
4
+ {
5
+ public function testOne ()
6
+ {
7
+ $ this ->assertEmbed (
8
+ 'http://play.cadenaser.com/audio/001RD010000004275766/ ' ,
9
+ [
10
+ 'title ' => "Debate electoral gallego, en 'Hoy por Hoy' | Cadena SER " ,
11
+ 'width ' => 620 ,
12
+ 'height ' => 100 ,
13
+ 'type ' => 'rich ' ,
14
+ 'code ' => '<iframe src="http://play.cadenaser.com/widget/audio/001RD010000004275766/" frameborder="0" allowTransparency="true" style="border:none;overflow:hidden;width:620px;height:100px;"></iframe> ' ,
15
+ 'providerName ' => 'Hoy por hoy ' ,
16
+ ]
17
+ );
18
+ }
19
+ }
You can’t perform that action at this time.
0 commit comments