Sandeep,

Two days ago i had to generate some keywords with a php script.
I hope this helps...

<?php
function off_simple_words($txt){
    $off = array('a','de','para','con','por','en','el','la','lo','los','las','desde','un','uno','una','unos','unas','sin','o','e','pues','son','ya','se','muy','y','como','que','del','es');/* get rid of words u don't want*/
    $off = '/\b('.implode('|',$off).')\b/';
    $txt = preg_replace($off,'',strtolower($txt));
    return $txt;
}
function off_line_breaks($txt){
    return preg_replace("((\t\r\n)+)", '', $txt);
}
function off_non_text($txt){
    $off = array(',',':',';','"',"'",'&','\b.','(',')');
    return str_replace($off,'',$txt);
}
function clean_string($txt){
    $txt = strip_tags($txt);
    $txt = html_entity_decode($txt);
    $txt = off_non_text($txt);
    $txt = off_simple_words($txt);
    $txt = off_line_breaks($txt);
    $txt = preg_replace('/\s+/',' ',$txt);
    return trim($txt);
}
function get_file_content($file){
    $lines = file($file);
    foreach($lines as $line){
       $file_content .= $line;
    }
    return $file_content;
}
function generate_file_metadata($file){
    $txt = get_file_content($file);
    $txt = clean_string($txt);
    $txt = explode(' ', $txt);
    $txt = array_unique($txt);
    return implode(' ', $txt);
}
$file = 'home.html';//your file
echo generate_file_metadata($file);
?>
what this script does is to get a string of unique keywords from an html file.

Regards,

On 11/13/06, Sandeep Vaidya (DL/LMI) < [EMAIL PROTECTED]> wrote:
Does anybody know a good tool to generate keywords off a input html
document?
For a long time, I used this link, but its stopped working for me now:

http://www.searchengineoptimising.com/keyword_generators/keywordgen.php

I paid to download a program called , http://www.softexe.com

But that company seems to be defunct......

Sandeep


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************




--
Ernesto
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to