Esempio n. 1
0
         $follower2->followers_count = $fol;
         $follower2->friends_count = $fri;
         $follower2->statuses_count = $status;
         $follower2->location = $place;
         $follower2->profile_image_url = $thumb;
         //echo $follower->id;
         $follower2_dao->add($follower2);
     }
 }
 $follower2 = "";
 //menghapus obje follower2
 //get data following dari following dan menyimpannya ke tabel following2
 $following_dao = new Following_dao();
 $data2 = $following_dao->getAll();
 $following2_dao = new Following2_dao();
 $following2_dao->deleteAll();
 foreach ($data2 as $datum2) {
     $following2_url = "http://api.twitter.com/1/statuses/friends/{$datum2->id}.json";
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, $following2_url);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     $curlout = curl_exec($ch);
     curl_close($ch);
     $following2 = json_decode($curlout, true);
     foreach ($following2 as $myfollowing2) {
         $myname = $myfollowing2['screen_name'];
         $thumb = $myfollowing2['profile_image_url'];
         $fol = $myfollowing2['followers_count'];
         $fri = $myfollowing2['friends_count'];
         $name = $myfollowing2['name'];
         $place = $myfollowing2['location'];