/** * Deletes a tweet with the given tweet id * * @param int $id Id of the tweet to delete * @param string $user UserId of the user who sent the tweet * * @return bool true on success */ function destroyTweet($id, $user) { global $prefs; $token = $this->get_user_preference($user, 'twitter_token', ''); if ($token == '') { return false; } $token = unserialize($token); $this->options['callbackUrl'] = $this->getURL(); $this->options['consumerKey'] = $prefs['socialnetworks_twitter_consumer_key']; $this->options['consumerSecret'] = $prefs['socialnetworks_twitter_consumer_secret']; $twitter = new Zend_Service_Twitter(array('oauthOptions' => array('consumerKey' => $prefs['socialnetworks_twitter_consumer_key'], 'consumerSecret' => $prefs['socialnetworks_twitter_consumer_secret']), 'accessToken' => $token)); try { $response = $twitter->statusesDestroy($id); } catch (Zend_Http_Client_Exception $e) { return false; } return true; }