Skip to content
/ Embed Public
forked from oscarotero/Embed

PHP library to embed any web service or page (oembed, opengraph, etc)

Notifications You must be signed in to change notification settings

mstadius/Embed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embed

PHP library to get info and embed any web page (using oembed, opengraph, twitter-cards, etc). It's compatible with any web service (youtube, vimeo, flickr, instagram, etc). Has adapters to some webpages like (archive.org, github, deviantart, etc).

Requirements:

  • PHP 5.3+
  • Curl library installed
  • A PSR-0 compatible autoloader class

Usage:

//Load library (if you don't have composer or any psr-0 compatible loader):
include('Embed/autoloader.php');

//Load any url:
$Url = new Embed\Url('https://www.youtube.com/watch?v=PP1xn5wHtxE');
$Info = Embed\Embed::create($Url);

//Get content info

$Info->title;
$Info->description;
$Info->url;
$Info->type;

$Info->images;
$Info->image;
$Info->imageWidth;
$Info->imageHeight;

$Info->code;
$Info->width;
$Info->height;
$Info->aspectRatio;

$Info->authorName;
$Info->authorUrl;

$Info->providerIcons;
$Info->providerIcon;
$Info->providerName;
$Info->providerUrl;

Online demo

http://oscarotero.com/embed/test.php

Contributors

https://github.com/oscarotero (creator and maintainer)

https://github.com/buggedcom

About

PHP library to embed any web service or page (oembed, opengraph, etc)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%