Пример #1
0
 private function scanReplies()
 {
     $keys = array_keys($this->threads);
     $loader = new TwitterLog();
     foreach (glob(ConfPath::rawStatusList()) as $path) {
         $loader->open($path);
         while ($loader->read1Line()) {
             $info = $loader->getArray();
             $id = $info['id'];
             if (in_array($id, $keys)) {
                 $this->replyState->learn($this->pickupText($info['text']), $this->threads[$id]['to']);
             }
         }
         $loader->close();
     }
 }
Пример #2
0
        fclose($file);
    }
}
///// run !
$users = array();
for ($i = 1; $argv[$i]; $i++) {
    $users[] = $argv[$i];
}
//$users = array(241032387);//hajimeh0shi
//$users = array(4029081);//hajimehoshi
//$users = array(19187659);//shokos
$users = array(212653601, 1);
//kawango
$table = KeywordsTable::singleton();
$table->loadTable(ConfPath::keywords());
$loader = new TwitterLog();
$score = new ScoreLogs();
$score->setTarget(3);
$score->setFilter(ConfPath::keywordsFilter());
foreach (glob(ConfPath::rawStatusList()) as $path) {
    $loader->open($path);
    while ($loader->read1Line()) {
        $info = $loader->getArray();
        if (!in_array($info['user_id'], $users)) {
            continue;
        }
        $mecab = mecab($info['text']);
        $info['mecab'] = $table->addKeywordIntoMecabInfo($mecab);
        $score->score($info);
    }
    $score->printCount();