emanueleminotto/embedly 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

emanueleminotto/embedly

最新稳定版本:1.1.0

Composer 安装命令:

composer require emanueleminotto/embedly

包简介

Library for embed.ly APIs

README 文档

README

Build Status SensioLabs Insight Coverage Status Scrutinizer Code Quality Total Downloads

Library for embed.ly APIs based on Guzzle 5.

API: emanueleminotto.github.io/Embedly

Install

Install the Embedly library adding emanueleminotto/embedly to your composer.json or from CLI:

$ composer require emanueleminotto/embedly

Read more about the Composer installation here: getcomposer.org/doc/00-intro.md

Usage

This library provides 3 API: embed.ly/docs/api.

Some APIs need an API key you can set in the constructor os using the setApiKey method. The second method of the constructor can be a Guzzle HTTP client to use as an alternative of the default one.

Embed

Options are available at http://embed.ly/docs/api/embed/arguments

For this method the $api_key can be null.

use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

$embed = $client->oembed([
    'url' => 'http://www.example.com/',
]);

// enumerated array containing
// arrays like $embed
$embeds = $client->oembed([
    'urls' => [
        'http://www.example.com/',
        'http://www.google.com/'
    ]
]);

Extract

Options are available at http://embed.ly/docs/api/embed/arguments

use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

$extracted = $client->extract([
    'url' => 'http://www.example.com/',
]);

// enumerated array containing
// arrays like $extracted
$extracteds = $client->oembed([
    'urls' => [
        'http://www.example.com/',
        'http://www.google.com/'
    ]
]);

Display

The first argument can be NULL, crop, resize or fill.

Options are available at

Currently the url attribute is required.

use EmanueleMinotto\Embedly\Client;

$client = new Client($api_key);

$content = $client->display('resize', [
    'url' => 'http://placehold.it/250x100',
    'color' => '000',
    'height' => 150,
    'width' => 150,
]);

Twig Extension

In this library there's included a Twig extension to allow a simple integration with frameworks.

Functions prefix is: embedly_, arguments are the same of the methods above.

{{ embedly_oembed({url: 'http://www.example.com'}).title }} {# Example Domain #}

统计信息

  • 总下载量: 1.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固