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
Dipity.php
52 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Dipity.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 dipity.com Provider |
| 17 | * @link http://www.dipity.com |
| 18 | */ |
| 19 | class Dipity extends \Embera\Adapters\Service |
| 20 | { |
| 21 | /** inline {@inheritdoc} */ |
| 22 | protected $apiUrl = 'http://www.dipity.com/oembed/timeline/?format=json'; |
| 23 | |
| 24 | /** inline {@inheritdoc} */ |
| 25 | protected function validateUrl() |
| 26 | { |
| 27 | $this->url->stripQueryString(); |
| 28 | |
| 29 | return (preg_match('~dipity\.com/(?:[^/]+)/(?:[^/]+)/?$~i', $this->url)); |
| 30 | } |
| 31 | |
| 32 | /** inline {@inheritdoc} */ |
| 33 | public function fakeResponse() |
| 34 | { |
| 35 | $this->url->stripLastSlash(); |
| 36 | $title = preg_replace('~^(.*)/~', '', $this->url); |
| 37 | $title = str_replace('-', ' ', $title); |
| 38 | |
| 39 | $html = '<div class="dipity_embed" style="width:{width}px; margin:0; padding:0;">'; |
| 40 | $html .= '<iframe width="{width}" height="{height}" src="' . (string) $this->url . '/?mode=embed&skin=true_mono&z=0#tl" style="border:1px solid #CCC;"></iframe>'; |
| 41 | $html .= '<p style="margin:0;font-family:Arial,sans;font-size:13px;text-align:center"><a href="' . (string) $this->url . '/">' . $title . '</a> on <a href="http://www.dipity.com/">Dipity</a>.</p>'; |
| 42 | $html .= '</div>'; |
| 43 | |
| 44 | return array( |
| 45 | 'type' => 'rich', |
| 46 | 'provider_name' => 'Dipity', |
| 47 | 'provider_url' => 'http://www.dipity.com', |
| 48 | 'html' => $html, |
| 49 | ); |
| 50 | } |
| 51 | } |
| 52 |