Skip to content
scottmac edited this page Sep 14, 2010 · 2 revisions

Open Graph Helper in PHP

This is a small helper script to help with the retrieval of pages that contain Open Graph Protocol data.

License

The code is under the Apache 2.0 License

Usage

<?php
require_once('OpenGraph.php');
$o = OpenGraph::fetch('http://www.rottentomatoes.com/m/10011268-oceans/');
if ($o) {
  var_dump($o->keys());
  var_dump($o->title);
  foreach ($o AS $key => $value) {
	echo "$key is $value\n";
  }
}
Clone this wiki locally