/** * mixiボイスに投稿 * * @param TW2MV_Message $message * @return bool */ function post($message) { // MV2TWのサフィックスが含まれていないチェック if (!empty($this->config->twitter_message_suffix) && mb_strpos($message->message, $this->config->twitter_message_suffix) !== FALSE) { return false; } // ポストキーの取得 if (empty($this->post_key)) { $this->get_post_key(); } // メッセージの作成 $datas = array('body' => $message->make_message(150, $this->config->mixi_voice_message_suffix), 'post_key' => $this->post_key, 'redirect' => 'recent_voice'); if ($this->config->core_fetch_only) { debug($datas); } else { $pages = $this->post_request(self::$HTTP_URI . 'add_voice.pl', $datas); // wait sleep($this->config->mixi_voice_post_interval); } }
/** * ダイレクトメッセージを投稿 * * @param TW2MV_Message $message * @param string $to * @return bool */ function direct_message($message, $to) { $datas = array('user' => $to, 'text' => $message->make_message(140, $this->config->twitter_message_suffix)); // 投稿 if ($this->config->core_fetch_only) { debug($datas); } else { $result = $this->_json_decode($this->post_request(self::$HTTP_URI . 'direct_messages/new.json', $datas, true)); } return empty($result->error); }