-
-
Save lealeelu/8e2da17afe7cd614d9ff to your computer and use it in GitHub Desktop.
File added to make ohms viewer work.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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