public function updateFeed()
 {
     // Update facebook
     $fb = new LeapFacebook();
     $fbFeeds = $fb->getPosts();
     $fbFeeds = $this->parseFacebookResponse($fbFeeds);
     $fbProfile = $fb->getFacebookProfile();
     $fbProfile = $this->parseFacebookProfile($fbProfile);
     // Update twitter
     $tw = new LeapTwitter();
     $twFeeds = $tw->getTweets();
     $twFeeds = $this->parseTwitterResponse($twFeeds);
     $twProfile = $tw->getProfile();
     $twProfile = $this->parseTwitterProfile($twProfile);
     // Update youtube
     $youtube = new LeapYoutube();
     $youtubeFeeds = $youtube->getPosts();
     $youtubeFeeds = $this->parseYoutubeResponse($youtubeFeeds);
     $youtubeProfile = $youtube->getProfile();
     $youtubeProfile = $this->parseYoutubeProfile($youtubeProfile);
     $arr = array();
     $arr["facebook"] = empty($fbFeeds) ? "fail" : "success";
     $arr["facebook_profile"] = empty($fbProfile) ? "fail" : "success";
     $arr["twitter"] = empty($twFeeds) ? "fail" : "success";
     $arr["twitter_profile"] = empty($twProfile) ? "fail" : "success";
     $arr["youtube"] = empty($youtubeFeeds) ? "fail" : "success";
     $arr["youtube_profile"] = empty($youtubeProfile) ? "fail" : "success";
     print_r(json_encode($arr));
 }
 function tw()
 {
     $pageID = addslashes($_REQUEST['pid']);
     $json = LeapTwitter::getTweetswID($pageID);
     echo $json;
     die;
 }