Giter Site home page Giter Site logo

embedly-php's Introduction

embedly-php

A PHP library for using the Embedly API. To find out what Embedly is all about, please visit http://embed.ly. To see our api documentation, visit http://api.embed.ly/docs.

Requirements

You will need at least PHP version 5.3 with curl enabled. Behat and PHPUnit are required to run the test suite. Pear is recommended.

Installing

To install:

1. Download the composer.phar executable or use the installer.

curl -sS https://getcomposer.org/installer | php

2. Install this package with comopser:

``php composer.phar require embedly/embedly-php``

Examples

<?php
require_once('Embedly/src/Embedly/Embedly.php');  // if using pear
// require_once('src/Embedly/Embedly.php');  // if using source
// require_once(__DIR__ . '/vendor/autoload.php'); // if using Composer

$api = new Embedly\Embedly(array('user_agent' => 'Mozilla/5.0 (compatible; mytestapp/1.0)'));

// Single url
$objs = $api->oembed('http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos');
print_r($objs);

// Multiple urls
$obj = $api->oembed(array(
    'urls' => array(
        'http://www.youtube.com/watch?v=sPbJ4Z5D-n4&feature=topvideos',
        'http://twitpic.com/3yr7hk'
    )
));
print_r($obj);

// Call with pro (you'll need a real key)
$pro = new Embedly\Embedly(array(
    'key' => 'xxxxxxxxxxxxxxxx',
    'user_agent' => 'Mozilla/5.0 (compatible; mytestapp/1.0)'
));
$objs = $pro->extract(array(
    'urls' => array(
        'http://www.guardian.co.uk/media/2011/jan/21/andy-coulson-phone-hacking-statement',
        'http://hn.embed.ly'
    )
));
print_r($objs);

Development

git clone git://github.com/embedly/embedly-php.git
curl -sS https://getcomposer.org/installer | php
php composer.phar install
export EMBEDLY_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
bin/behat

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2011 Embed.ly, Inc. See MIT-LICENSE for details.

embedly-php's People

Contributors

arijitchakraborty avatar brice avatar dokipen avatar konradpodgorski avatar mattwright avatar piotrantosik avatar robo47 avatar shinychang avatar sveneisenschmidt avatar uzairfarooq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

embedly-php's Issues

question: is it better to use embedly-php or embedly-jquery?

I ask it just for an advice. I'm building a plugin for a cms to share it in the cms community and I decide to use embedly-php to store data in db from urls. and embedly-jquery for all site (where there are urls in text and comments.) ....so just to ask... is there a better method to store data between embedly php or jquery...in terms of loading page and safe data...or there isn't any difference between these 2 methods?

white page on php example

hi embedly team,
i have a white page trying embedly-php / examples / oembed.php
in particular on this line:
$oembeds = $api->oembed(array('urls' => $urls)); //, 'maxwidth' => 200));

Can you help me to solve it and to try this great script?
thanks in advance

Tag latest code from master?

Can you create a new tag (maybe v0.5.5) for the latest code that is in master? I am using this in my project and would like to use a tagged version instead of using the master branch.

v0.5.4...master

Thank you
matt

flickr service

trying Flickr, now it returns: This photo is currently unavailable. but all data are good. for example i can see thumbler img but not the main photo

the same flickr url works if I use embedly-jquey on fly

Fill available space?

I'm trying to use the PHP API in place of the javascript version because I have a lot of server side processing I need to do. However I also want to have the video fill available space (width) on the client. Is there a way to pass an argument in place of the maxwidth so that the embed code will do this automagically?

Create New Release / Tag

Can you please create a new release with the latest code changes so devs can pull it in via composer? The last one is from February 2015.

Thanks!

Could you please tag a new version?

Hello,

In order to handle properly our libraries, we use version in our composer.json file. But the last version (v0.5.1) contains a print in q function that make embed ly request fail.

Do you plan to create a v0.5.2 to allow to use proper version?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.