Embed

Get info from any web service or page

MIT License

Downloads
7.6M
Stars
2.1K
Committers
71

Bot releases are visible (Hide)

Embed - 2.2

Published by oscarotero over 9 years ago

New imagesBlacklist option to define the images you want to avoid (Thank, @Soullivaneuh). You can use * and ? special characters in this way:

$config = [
    'adapter' => [
        'config' => [
            'minImageWidth' => 16,
            'minImageHeight' => 16,
            'imagesBlacklist' => [
                'http://example.com/full/path/to/image.jpg', //images with this exact url
                'https?://ugglyimages.com/*', //images begining by "http://ugglyimages.com/" (http or https)
                '*/bad_image.gif', //image ending in "/bad_image.gif"
                'https?://test.*/*.png/', //more complex pattern
            ]
        ]
    ]
];
Embed - 2.1.2

Published by oscarotero over 9 years ago

Fixed SoundCloud clips with no artwork causes error #52

Embed - 2.1.1

Published by oscarotero over 9 years ago

Fixed Facebook adapter (missing namespace) #51

Embed - 2.1.0

Published by oscarotero over 9 years ago

  • Improved the capture of images in the html. The images with rel="nofollow" will be ignored
  • More info provided by each image: width, height, mime, size, url and providers in which appears
  • The $info->images array is numeric.
  • Improved the way of choose the main image. Now the bigger image found in the first provided will be choosen by default.
Embed - 2.0.1

Published by oscarotero over 9 years ago

New methods getImagesUrl() and getProviderIconsUrls() to retrieve only the image urls, without check the mimetype and dimmensions. This fixes #50

Embed - 2.0

Published by oscarotero over 9 years ago

  • Removed support for php 5.3. If you need support for this, use the 1.x version.

  • Removed FastImage to get the images dimmension. Now we have Embed\ImageInfo\Curl that can execute parallel requests and uses getimagesizefromstring to get the image dimmensions.

  • Changed the configuration array. Now it has subarrays to provide options for adapters, providers, resolvers and images. See readme for more info.

  • The images and providerIcons properties returns not only the url but also the mimetype and dimmensions:

    //v.1x
    var_dump($info->images);
    /*
    array(
      'http://example.com/images/image1.jpg',
      'http://example.com/images/image2.jpg'
    );
    */
    
    //v2.x
    var_dump($info->images);
    /*
    array(
      'http://example.com/images/image1.jpg' => array(
        0 => 200,
        1 => 500,
        2 => 'image/jpeg',
      ),
      'http://example.com/images/image2.jpg' => array(
        0 => 320,
        1 => 545,
        2 => 'image/jpeg',
      )
    );
    */
    
Embed - 1.8.3

Published by oscarotero over 9 years ago

  • fixed Resolver that cannot be configured #46
Embed - 1.8.2

Published by oscarotero almost 10 years ago

  • New adapter for slides.com #36
  • New adapter for line.do #41
  • Fixed soundcloud adapter with mobile urls #43 #44
Embed - 1.8.1

Published by oscarotero almost 10 years ago

Fixed composer configuration #39

Embed - 1.8.0

Published by oscarotero almost 10 years ago

  • Changed to PSR-4 autoloader
  • PSR-1/2 code style fixes
  • Removed some deprecated adapters: Cadenaser, Marca, Parleys, Rtve, Yfrog
  • Changes in the Embed\Request class and Embed\RequestResolvers\RequestResolverInterface
  • A lot of fixes and new tests
  • Changed the way to configure the resolver. Now it's configured with the rest of the options under the "resolver" subarray:
//Old style:
Embed\Request::setResolverConfig(array(
    'userAgent' => 'My spider',
    'connectionTimeout' => 10
));

$info = Embed\Embed::create($url);

//New style
$info = Embed\Embed::create($url, array(
    'resolver' => array(
        "options" => array(
            CURLOPT_USERAGENT => 'My spider',
            CURLOPT_CONNECTTIMEOUT => 10
        )
    )
));
Embed - 1.7.0

Published by oscarotero about 10 years ago

  • Changed the way to detect the bigger image when 'getBiggerImage' or 'getBiggerIcon' is true. Until now the php function arsort was used but it doesn't work fine with images with the same dimmensions. From now, it returns the first bigger image found (the first images are suppossed to be the more relevants).
  • The options for the Curl request resolver have been changed to camelCase for more consistency with the other options
  • Improvements in the demo page.
Embed - 1.6.0

Published by oscarotero about 10 years ago

  • By default, the facebook provider is disabled, to reduce the number of requests and avoid weird values. You can enable it again setting the config option facebookProvider to true
  • If the url is to a binary file (image, pdf, etc) the Curl request resolver does not download the content, only the headers. This avoid download large files unnecesary.
Embed - 1.5.9

Published by oscarotero about 10 years ago

  • Added an adapter for giphy.com (the default adapter returns a not so good embed code)
  • Added ignoreFacebookProvider option to not use the facebook scrapping (sometimes returns weird values)
Embed - 1.5.8

Published by oscarotero about 10 years ago

Fixed a bug that return null in imageWith/imageHeight in some circunstances

Embed - 1.5.7

Published by oscarotero over 10 years ago

Ignored the demos in the releases

Embed - 1.5.6

Published by oscarotero over 10 years ago

Moved the demos to a subdirectory

Embed - 1.5.5

Published by oscarotero over 10 years ago

  • Updated facebook embed code #32
  • Fixes in url redirections
Embed - 1.5.4

Published by oscarotero over 10 years ago

  • Fixed Rdio adapter (now it works with https) #28
  • Fixed Facebook adapter (The embed code was mising in some urls) #29
  • Now gists urls are type "rich" instead "url" #30
  • Added support for urls with hash bangs #31
Embed - 1.5.3

Published by oscarotero over 10 years ago

  • Fixed some types of domains #25
  • Added oembed provider of TED videos #26
Embed - 1.5.2

Published by oscarotero over 10 years ago

Added automatic redirections for google url shortener and google translate