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
Scribd.php
57 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Scribd.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 scribd.com Provider |
| 17 | * @link http://scribd.com |
| 18 | */ |
| 19 | class Scribd extends \Embera\Adapters\Service |
| 20 | { |
| 21 | /** inline {@inheritdoc} */ |
| 22 | protected $apiUrl = 'http://www.scribd.com/services/oembed/?format=json'; |
| 23 | |
| 24 | /** inline {@inheritdoc} */ |
| 25 | protected function validateUrl() |
| 26 | { |
| 27 | $this->url->stripQueryString(); |
| 28 | |
| 29 | return (preg_match('~scribd\.com/doc/(?:[0-9]+)/(?:[^/]+)/?$~i', $this->url)); |
| 30 | } |
| 31 | |
| 32 | /** inline {@inheritdoc} */ |
| 33 | protected function modifyResponse(array $response = array()) |
| 34 | { |
| 35 | if (!empty($response['html'])) |
| 36 | { |
| 37 | $response['html'] = str_replace('#{root_url}', 'http://www.scribd.com/', $response['html']); |
| 38 | $response['html'] = preg_replace('~\s+~i', ' ', $response['html']); // Remove double spaces |
| 39 | } |
| 40 | |
| 41 | return $response; |
| 42 | } |
| 43 | |
| 44 | /** inline {@inheritdoc} */ |
| 45 | public function fakeResponse() |
| 46 | { |
| 47 | preg_match('~/doc/([\d]+)/~i', $this->url, $matches); |
| 48 | |
| 49 | return array( |
| 50 | 'type' => 'rich', |
| 51 | 'provider_name' => 'Scribd', |
| 52 | 'provider_url' => 'http://www.scribd.com', |
| 53 | 'html' => '<iframe class="scribd_iframe_embed" data-aspect-ratio="" frameborder="0" height="{height}" id="' . $matches['1'] . '" scrolling="no" src="http://www.scribd.com/embeds/' . $matches['1'] . '/content" width="100%"></iframe><script type="text/javascript">(function() { var scribd = document.createElement("script"); scribd.type = "text/javascript"; scribd.async = true; scribd.src = "http://www.scribd.com/javascripts/embed_code/inject.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(scribd, s); })();</script>', |
| 54 | ); |
| 55 | } |
| 56 | } |
| 57 |