Skip to content

Instantly share code, notes, and snippets.

@lealeelu
Created May 28, 2015 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lealeelu/8e2da17afe7cd614d9ff to your computer and use it in GitHub Desktop.
Save lealeelu/8e2da17afe7cd614d9ff to your computer and use it in GitHub Desktop.
File added to make ohms viewer work.
<?php
$dom = new DOMDocument;
$html = file_get_contents($cacheFile->media_url);
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$nlist = $xpath->query("//link[@type='application/json+oembed']/@href");
$oembed = $nlist->item(0)->nodeValue;
$oembed = $oembed . "&maxwidth=270";
echo $oembed;
$html_oembed = file_get_contents($oembed);
$jsond = json_decode($html_oembed);
echo $jsond->html;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment