public function publish(ISocialStatus $status)
 {
     $params = array('status' => $status->getStatusString());
     $tmhOAuthEngine = new tmhOAuth($this->_config);
     $response = $tmhOAuthEngine->user_request(array('method' => 'POST', 'url' => $tmhOAuthEngine->url("1.1/statuses/update"), 'params' => $params, 'multipart' => true));
     if ($response != 200) {
         throw new Exception('Unable to publish on Twitter (ERR: ' . $response . ')');
     }
 }
 public function publish(ISocialStatus $status)
 {
     $facebook = new Facebook($this->_config);
     $user = $facebook->getUser();
     if ($user) {
         try {
             $page_info = $facebook->api("/{$this->_pageId}?fields=access_token");
             if (!empty($page_info['access_token'])) {
                 $attachment = array('access_token' => $page_info['access_token'], 'message' => $status->getStatusString());
                 $status = $facebook->api("/{$this->_pageId}/feed", "post", $attachment);
             } else {
                 $status = 'No access token recieved';
             }
         } catch (FacebookApiException $e) {
             $user = null;
             throw new Exception('Unable to post on Facebook.');
         }
     } else {
         header("Location:{$facebook->getLoginUrl(array('scope' => 'photo_upload,user_status,publish_stream,user_photos,manage_pages'))}");
     }
 }