Вход Регистрация
Файл: sngine-v2.8/Script/includes/libs/Embed/Providers/OEmbed/Tumblr.php
Строк: 35
<?php

namespace EmbedProvidersOEmbed;

use 
EmbedAdaptersAdapter;
use 
EmbedHttpResponse;
use 
EmbedHttpUrl;

class 
Tumblr extends EndPoint implements EndPointInterface
{
    protected static 
$pattern = [
        
'*.tumblr.com/post/*'
    
];

    protected static 
$endPoint 'https://www.tumblr.com/oembed/1.0';

    
/**
     * {@inheritdoc}
     */
    
public static function create(Adapter $adapter)
    {
        
$response $adapter->getResponse();

        if (
$response->getStartingUrl()->match(static::$pattern)) {
            return new static(
$response);
        }
    }

    
/**
     * {@inheritdoc}
     */
    
public function getEndPoint()
    {
        return 
Url::create(static::$endPoint)
                ->
withQueryParameters([
                    
'url' => (string) $this->response->getStartingUrl()
                ]);
    }
}
Онлайн: 0
Реклама