} elseif ($author->get_email() !== null) { $newitem->addElement('dc:creator', $author->get_email()); } } } elseif ($authors = $extractor->getAuthors()) { //TODO: make sure the list size is reasonable foreach ($authors as $author) { // TODO: xpath often selects authors from other articles linked from the page. // for now choose first item $newitem->addElement('dc:creator', $author); break; } } // add language if ($detect_language) { $language = $extractor->getLanguage(); if (!$language) { $language = $feed->get_language(); } if (($detect_language == 3 || !$language && $detect_language == 2) && $text_sample) { try { if ($use_cld) { // Use PHP-CLD extension $php_cld = 'CLD\\detect'; // in quotes to prevent PHP 5.2 parse error $res = $php_cld($text_sample); if (is_array($res) && count($res) > 0) { $language = $res[0]['code']; } } else { //die('what');