fusonic/opengraph 1.0.0

A simple PHP library to read Open Graph data from the web or publish your own resources.

Download .zip Project on GitHub

A simple library to read Open Graph data from the web and generate HTML code to publish your own Open Graph objects. A fallback mode enables you to read data from websites that do not implement the Open Graph protocol.

Using this library you can easily retrieve stuff like meta data, video information from YouTube or Vimeo or image information from Flickr without using site-specific APIs since they all implement the Open Graph protocol.

See ogp.me for information on the Open Graph protocol.

Requirements

Installation

The most flexible installation method is using Composer: Simply create a composer.json file in the root of your project:

{
    "require": {
        "fusonic/opengraph": "@dev"
    }
}

Install composer and run install command:

curl -s http://getcomposer.org/installer | php
php composer.phar install

Once installed, include vendor/autoload.php in your script.

require "vendor/autoload.php";

License

This library is licensed under the MIT license.