- }
-
- if ((@$siteinfo["image"] == "") AND !$no_guessing) {
- $list = $xpath->query("//img[@src]");
- foreach ($list as $node) {
- $attr = array();
- if ($node->attributes->length)
- foreach ($node->attributes as $attribute)
- $attr[$attribute->name] = $attribute->value;
-
- $src = completeurl($attr["src"], $url);
- $photodata = get_photo_info($src);
-
- if (($photodata) && ($photodata[0] > 150) and ($photodata[1] > 150)) {
- if ($photodata[0] > 300) {
- $photodata[1] = round($photodata[1] * (300 / $photodata[0]));
- $photodata[0] = 300;
- }
- if ($photodata[1] > 300) {
- $photodata[0] = round($photodata[0] * (300 / $photodata[1]));
- $photodata[1] = 300;
- }
- $siteinfo["images"][] = array("src"=>$src,
- "width"=>$photodata[0],
- "height"=>$photodata[1]);
- }
-
- }
- } elseif ($siteinfo["image"] != "") {
- $src = completeurl($siteinfo["image"], $url);
-
- unset($siteinfo["image"]);
-
- $photodata = get_photo_info($src);
-
- if (($photodata) && ($photodata[0] > 10) and ($photodata[1] > 10))
- $siteinfo["images"][] = array("src"=>$src,
- "width"=>$photodata[0],
- "height"=>$photodata[1]);
- }
-
- if ((@$siteinfo["text"] == "") AND (@$siteinfo["title"] != "") AND !$no_guessing) {
- $text = "";
-
- $list = $xpath->query("//div[@class='article']");
- foreach ($list as $node)
- if (strlen($node->nodeValue) > 40)
- $text .= " ".trim($node->nodeValue);
-
- if ($text == "") {
- $list = $xpath->query("//div[@class='content']");
- foreach ($list as $node)
- if (strlen($node->nodeValue) > 40)
- $text .= " ".trim($node->nodeValue);