예제 #1
0
     $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;
     $following->statuses_count = $status;
     $following->location = $place;
     $following->profile_image_url = $thumb;
     //echo $follower->id;
     $following_dao->add($following);
 }
 $following = "";
 //menghapus objek following
 //get data follower dari following dan menyimpannya ke tabel follower2
 $following_dao = new Following_dao();
 $data = $following_dao->getAll();
 $follower2_dao = new Follower2_dao();
 $follower2_dao->deleteAll();
 foreach ($data as $datum) {
     $followers_url = "http://api.twitter.com/1/statuses/followers/{$datum->id}.json";
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $followers_url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     $curlout = curl_exec($ch);
     curl_close($ch);