search(['count' => 30, 'q' => urlencode($search), " result_type" => "recent", 'tweet_mode' => 'extended', 'locale' => 'id']); foreach($results as $tweet){ $string = $tweet->full_text; //cleasing $text_clean = new Clean($string); $text_clean = $text_clean->toString(); //stem $text_stem = $stemmer->stem($text_clean); if(empty($text_stem)){ $notIn++; break; } // calculations: $scores = $sentiment->score($text_stem); $class = $sentiment->categorise($text_stem); if($db->query("SELECT id FROM tweets WHERE id_tweet = '$tweet->id'")->count() == 0){ $data = [ "id_tweet" => $tweet->id, "text_dirty" => $string, "text_clean" => $text_clean, "text_steam" => $text_stem, "label" => $class, "hastag" => $search ]; if($db->insert("tweets", $data)){ $ok++; } }else{ $tidakOk++; } } } $page = (isset($_GET['page'])) ? $_GET['page'] : 1; ?>
Tweet baru dimasukan, sudah ada , kosong

Ambil Data

Daftar Barang

Total record : tweets->count() ?>

tweets->paginate(15, $page,['id' => 'DESC']) as $tweet): ?>
Id Tweet Tweet Text Clean Text Stem Label Kunci