$follower->profile_image_url = $thumb; //echo $follower->id; $follower_dao->add($follower); } $follower = ""; //menghapus objek follower //mengambil data following dari user dan menyimpannya ke tabel following $following_url = "http://api.twitter.com/1/statuses/friends/{$user->id}.json"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $following_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $curlout = curl_exec($ch); curl_close($ch); $following = json_decode($curlout, true); $following_dao = new Following_dao(); $following_dao->deleteAll(); foreach ($following as $myfollowing) { $myname = $myfollowing['screen_name']; $thumb = $myfollowing['profile_image_url']; $fol = $myfollowing['followers_count']; $fri = $myfollowing['friends_count']; $name = $myfollowing['name']; $place = $myfollowing['location']; $id = $myfollowing['id']; $status = $myfollowing['statuses_count']; $following = new Following(); $following->id = $id; $following->name = $name; $following->screen_name = $myname; $following->followers_count = $fol; $following->friends_count = $fri;