Forkaya
-
PHP Scripts
-
URL Fetch
This script fetches/extracts Title, Description, and Keywords from webpages using specified URL
Enter URL:
Hide Source Code
'); //close cURL resource, and free up system resources curl_close($cURL); if (strlen($reply_page) == 0) { $eMsg .= 'Website unavailable.
'; $isError = true; } else { //determine the website's charset $wbCharset = get_charset($aCharsets,$reply_page); //we do not need header anymore $reply_page = strstr($reply_page,' tag //right after tag to make DOM 'happy' $reply_page = str_ireplace( '', '
', $reply_page); $pageDOM = new DOMDocument(); @$pageDOM->loadHTML($reply_page); //Title $title_elements = $pageDOM->getElementsByTagName('title'); if ($title_elements->length <> 0) { $aValues['title'] = $title_elements->item(0)->nodeValue; } $meta_elements = $pageDOM->getElementsByTagName('meta'); foreach ($meta_elements as $meta_element) { if (strtolower($meta_element->getAttribute('name')) == 'description') { $aValues['description'] = $meta_element->getAttribute('content'); } if (strtolower($meta_element->getAttribute('name')) == 'keywords') { $aValues['keywords'] = $meta_element->getAttribute('content'); } } } } } if (isset($_GET['source'])) { if ($_GET['source'] == 1) { $sourceStr = file_get_contents('url-fetch-source.php'); $sourceVisible = true; $sourceText = $sourceText_NotVisible; $sourceValue = 0; } else { $sourceVisible = false; $sourceText = $sourceText_Visible; $sourceValue = 1; } } else { $sourceText = $sourceText_Visible; $sourceValue = 1; } header('Content-Type: text/html; charset=utf-8'); /* * DISPLAY SECTION ********************************************************************************************************************************** */ ?>
Forkaya - PHP Scripts - URL Fetch - Extract Title, Description, and Keywords from URL
Forkaya
-
PHP Scripts
-
URL Fetch
This script fetches/extracts Title, Description, and Keywords from webpages using specified URL
'.$eMsg.'
'); } ?>
Enter URL:
Title:
'.$aValues['title'].'
Description:
'.$aValues['description'].'
Keywords:
'.$aValues['keywords'].'
'); } if($sourceVisible) { echo('
'.$sourceStr.'
'); } ?>
-->