AmCharts.php
8 years ago
Animatron.php
8 years ago
Animoto.php
8 years ago
AolOn.php
8 years ago
AppNet.php
8 years ago
AudioSnaps.php
8 years ago
Bambuser.php
8 years ago
BlipTV.php
8 years ago
Cacoo.php
8 years ago
Chartblocks.php
8 years ago
Chirbit.php
8 years ago
CircuitLab.php
8 years ago
Clipland.php
8 years ago
Clyp.php
8 years ago
Codepoints.php
8 years ago
CollegeHumor.php
8 years ago
Coub.php
8 years ago
CrowdRanking.php
8 years ago
DailyMile.php
8 years ago
DailyMotion.php
8 years ago
Deviantart.php
8 years ago
Didacte.php
8 years ago
Dipity.php
8 years ago
DotSub.php
8 years ago
Edocr.php
8 years ago
EgliseInfo.php
8 years ago
Facebook.php
8 years ago
Flickr.php
8 years ago
FunnyOrDie.php
8 years ago
GeographCI.php
8 years ago
GeographDe.php
8 years ago
GeographUk.php
8 years ago
GettyImages.php
8 years ago
Gfycat.php
8 years ago
GithubGist.php
8 years ago
Gmep.php
8 years ago
Hq23.php
8 years ago
Huffduffer.php
8 years ago
Hulu.php
8 years ago
IFTTT.php
8 years ago
IFixIt.php
8 years ago
Infogram.php
8 years ago
Instagram.php
8 years ago
Issuu.php
8 years ago
Kickstarter.php
8 years ago
LearningApps.php
8 years ago
Meetup.php
8 years ago
MixCloud.php
8 years ago
MobyPicture.php
8 years ago
NFB.php
8 years ago
Officemix.php
8 years ago
OfficialFM.php
8 years ago
Oumy.php
8 years ago
Pastery.php
8 years ago
PollDaddy.php
8 years ago
PollEveryWhere.php
8 years ago
Portfolium.php
8 years ago
Rapidengage.php
8 years ago
Rdio.php
8 years ago
ReleaseWire.php
8 years ago
RepubHub.php
8 years ago
Reverbnation.php
8 years ago
Revision3.php
8 years ago
Roomshare.php
8 years ago
Rutube.php
8 years ago
Sapo.php
8 years ago
Screenr.php
8 years ago
Scribd.php
8 years ago
ShortNote.php
8 years ago
Shoudio.php
8 years ago
Showtheway.php
8 years ago
Silk.php
8 years ago
Sketchfab.php
8 years ago
SlideShare.php
8 years ago
SoundCloud.php
8 years ago
Speakerdeck.php
8 years ago
Spotify.php
8 years ago
StreamOneCloud.php
8 years ago
Streamable.php
8 years ago
Sway.php
8 years ago
Ted.php
8 years ago
TheySaidSo.php
8 years ago
Twitter.php
8 years ago
Ustream.php
8 years ago
Verse.php
8 years ago
Vevo.php
8 years ago
Viddler.php
8 years ago
VideoFork.php
8 years ago
VideoJug.php
8 years ago
Vimeo.php
8 years ago
Vine.php
8 years ago
WordpressTV.php
8 years ago
YFrog.php
8 years ago
Yandex.php
8 years ago
Youtube.php
8 years ago
CircuitLab.php
55 lines
| 1 | <?php |
| 2 | /** |
| 3 | * CircuitLab.php |
| 4 | * |
| 5 | * @package Providers |
| 6 | * @author Michael Pratt <pratt@hablarmierda.net> |
| 7 | * @link http://www.michael-pratt.com/ |
| 8 | * |
| 9 | * For the full copyright and license information, please view the LICENSE |
| 10 | * file that was distributed with this source code. |
| 11 | */ |
| 12 | |
| 13 | namespace Embera\Providers; |
| 14 | |
| 15 | /** |
| 16 | * The circuitlab.com Provider |
| 17 | * @link https://www.circuitlab.com |
| 18 | */ |
| 19 | class CircuitLab extends \Embera\Adapters\Service |
| 20 | { |
| 21 | /** inline {@inheritdoc} */ |
| 22 | protected $apiUrl = 'https://www.circuitlab.com/circuit/oembed/'; |
| 23 | |
| 24 | /** inline {@inheritdoc} */ |
| 25 | protected function validateUrl() |
| 26 | { |
| 27 | $this->url->addWWW(); |
| 28 | $this->url->convertToHttps(); |
| 29 | $this->url->stripQueryString(); |
| 30 | |
| 31 | return (preg_match('~circuitlab\.com/circuit/(?:[\w\d]+)/(?:[^/]*)/?$~i', $this->url)); |
| 32 | } |
| 33 | |
| 34 | /** inline {@inheritdoc} */ |
| 35 | protected function normalizeUrl() |
| 36 | { |
| 37 | if (preg_match('~circuitlab\.com/c([\w\d]+)/?$~i', $this->url, $matches)) { |
| 38 | $this->url = new \Embera\Url('https://www.circuitlab.com/circuit/' . $matches['1'] . '/'); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /** inline {@inheritdoc} */ |
| 43 | public function fakeResponse() |
| 44 | { |
| 45 | preg_match('~circuitlab\.com/circuit/([\w\d]+)/~i', $this->url, $matches); |
| 46 | |
| 47 | return array( |
| 48 | 'type' => 'rich', |
| 49 | 'provider_name' => 'CircuitLab', |
| 50 | 'provider_url' => 'https://www.circuitlab.com/', |
| 51 | 'html' => '<iframe src="https://www.circuitlab.com/circuit/' . $matches['1'] . '/embed_target/?width={width}" scrolling="no" frameborder="0" width="{width}" height="{height}"></iframe>', |
| 52 | ); |
| 53 | } |
| 54 | } |
| 55 |