php_PickupKeywords
description
constructor
- $pk = new PickupKeywords();
property
- public $search_tags = 'h1,h2,h3,h4,h5,title,span,div,li,a,input[type="text"][value]'; //selection rule for tag in html
- public $search_metas = 'meta[name="description"],meta[name="keywords"],meta[property="og:title"],meta[property="og:description"]'; //selection rule for metatag in html
- public $user_agent = 'Mozilla/5.0 PickupKeywords'; //user-agent for getHTML method
- public $conf_scores = array('h1'=>50,'h2'=>40,...); // tag score
- public $min_length = 2; //min-length for word
- public $max_length = 100; //max-length for word
- public $numeric_multiple = 1;//Weighting on numbers (0: ignore numbers)
method
- string $html = getHTML($url) : get HTML from URL
- void setUrl($url) : Setting url for personal property variable html setting
- void setHTML($html) : Setting html for personal property variable html setting
- Array $splited_words = split_tags_string($string) : String division using delimiters
- Array $texts = getMetas() : Get meta tags using $search_metas.
- Array $texts = getTags() : Get tags using $search_tags.
- Array $texts = getTexts() : getMetas() + getTags() = Texts(with in tagname,text,score)
- Array $words = getWords($texts) : Texts to words (words is splited from text)
structure
- $texts = array(array('tag'=>$tag,'text'=>$text,'score'=>$score), ...);
- $words = array(array('word'=>$keyword,'count'=>0,'score'=>0), ...);
etc
- PickupKeywords_my_sort($a,$b) : function for sorting