-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# [Genially](https://genially.com) | ||
|
||
Genially Provider | ||
Engage your audience with clickable, gamified, media-rich experiences. | ||
Create your interactive content now! | ||
|
||
## Implementation Details | ||
|
||
- Provider Name: Genially | ||
- Documentation: NO | ||
- HTTPS support: YES | ||
- Fake Response: NO | ||
- Oembed Params: NO | ||
- Supported Hosts: view.genially.com, view.genial.ly | ||
- Responsive response: YES | ||
- Collections: DefaultProviderCollection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
/** | ||
* Genially.php | ||
* | ||
* @package Embera | ||
* @author Matías Minevitz <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Embera\Provider; | ||
|
||
use Embera\Url; | ||
|
||
/** | ||
* Genially Provider | ||
* Engage your audience with clickable, gamified, media-rich experiences. Create your interactive content now! | ||
* | ||
* @link https://genially.com | ||
*/ | ||
class Genially extends ProviderAdapter implements ProviderInterface | ||
{ | ||
/** inline {@inheritdoc} */ | ||
protected $endpoint = 'https://genially.com/services/oembed?format=json'; | ||
|
||
/** inline {@inheritdoc} */ | ||
protected static $hosts = [ | ||
'*.genial.ly', | ||
'*.genially.com', | ||
]; | ||
|
||
/** inline {@inheritdoc} */ | ||
protected $httpsSupport = true; | ||
|
||
/** inline {@inheritdoc} */ | ||
protected $responsiveSupport = true; | ||
|
||
/** inline {@inheritdoc} */ | ||
public function validateUrl(Url $url) | ||
{ | ||
return (bool) (preg_match('~view\.(?:genial\.ly|genially\.com)/[a-z0-9]{24}(?:$|/)~i', (string) $url)); | ||
} | ||
|
||
/** inline {@inheritdoc} */ | ||
public function normalizeUrl(Url $url) | ||
{ | ||
$url->convertToHttps(); | ||
$url->removeQueryString(); | ||
|
||
return $url; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* GeniallyTest.php | ||
* | ||
* @package Embera | ||
* @author Matías Minevitz <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Embera\Provider; | ||
|
||
use Embera\ProviderTester; | ||
|
||
/** | ||
* Test the Genially Provider | ||
*/ | ||
final class GeniallyTest extends ProviderTester | ||
{ | ||
protected $tasks = [ | ||
'valid_urls' => [ | ||
'https://view.genially.com/66560826885e160014487db5', | ||
'https://view.genially.com/66560826885e160014487db5/', | ||
'https://view.genially.com/66560826885e160014487db5/asd', | ||
'https://view.genial.ly/663449c0ebfbaa0014b24cc9', | ||
'https://view.genial.ly/663449c0ebfbaa0014b24cc9/', | ||
'https://view.genial.ly/663449c0ebfbaa0014b24cc9/asd', | ||
], | ||
'invalid_urls' => [ | ||
'https://view.genially.com/66560826885e160014487db', | ||
'https://view.genially.com/66560826885e160014487db5a', | ||
'https://view.genially.com/en/66560826885e160014487db5', | ||
'https://view.genial.ly/en/663449c0ebfbaa0014b24cc9', | ||
'https://view.genial.ly/663449c0ebfbaa0014b24cc', | ||
'https://view.genial.ly/663449c0ebfbaa0014b24cc9a', | ||
], | ||
]; | ||
|
||
public function testProvider() | ||
{ | ||
$this->validateProvider('Genially', ['width' => 480, 'height' => 270]); | ||
} | ||
} |