$oembed_data = oembed_fetch_url($url);
+ if ($oembed_data->type != "error")
+ $siteinfo["type"] = $oembed_data->type;
+
if ($oembed_data->type == "link") {
if (isset($oembed_data->title))
$siteinfo["title"] = $oembed_data->title;
$siteinfo["image"] = $attr["content"];
break;
case "twitter:card":
- $siteinfo["type"] = $attr["content"];
+ if ($siteinfo["type"] == "")
+ $siteinfo["type"] = $attr["content"];
break;
case "twitter:description":
$siteinfo["text"] = $attr["content"];
$siteinfo["text"] = $attr["content"];
break;
}
+ if ($siteinfo["type"] == "summary")
+ $siteinfo["type"] = "link";
}
//$list = $xpath->query("head/meta[@property]");
$total_images ++;
if($max_images && $max_images >= $total_images)
break;
- }
+ }
}
if(strlen($text)) {
$sitedata .= trim($result);
- if (($siteinfo["type"] != "photo"))
+ if (($siteinfo["type"] == "video") AND ($url != ""))
+ echo "[video]".$url."[/video]";
+ elseif (($siteinfo["type"] != "photo"))
echo "[class=type-link]".$sitedata."[/class]";
else
echo "[class=type-photo]".$title.$br.$image."[/class]";