File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change 55namespace Embed \Adapters ;
66
77use Embed \Request ;
8+ use Embed \Providers \Provider ;
89
910class Github extends Webpage implements AdapterInterface
1011{
@@ -22,24 +23,27 @@ public static function check(Request $request)
2223 /**
2324 * {@inheritDoc}
2425 */
25- public function getCode ( )
26+ protected function initProviders ( Request $ request )
2627 {
27- $ url = $ this -> getUrl ( );
28+ parent :: initProviders ( $ request );
2829
29- if (substr ($ url , -1 ) === '/ ' ) {
30- $ url = substr ($ url , 0 , -1 );
31- }
30+ $ this ->api = new Provider ();
31+ $ api = new Request ($ request ->getUrl ().'.json ' );
3232
33- return '<script src=" ' .$ url .'.js"></script> ' ;
33+ if (($ json = $ api ->getJsonContent ())) {
34+ $ this ->api ->set ($ json );
35+ }
3436 }
3537
3638
3739 /**
3840 * {@inheritDoc}
3941 */
40- public function getUrl ()
42+ public function getCode ()
4143 {
42- return $ this ->request ->getUrl ();
44+ if (($ code = $ this ->api ->get ('div ' )) && ($ stylesheet = $ this ->api ->get ('stylesheet ' ))) {
45+ return '<link href=" ' .$ stylesheet .'" rel="stylesheet"> ' .$ code ;
46+ }
4347 }
4448
4549
You can’t perform that action at this time.
0 commit comments