public static function parse($response) { if (Tag::setof($tag, $response, "error")) { throw new Exception($tag->value()); } if (Tag::setof($tag, $response, "status")) { $hash = $tag->hash(); $obj = new self(); $obj->user(TwitterUser::parse($hash["user"])); unset($hash["user"]); return $obj->cp($hash); } throw new Exception("invalid data"); }
public static function parse($response) { if (Tag::setof($tag, $response, "error")) { throw new Exception($tag->value()); } $result = array(); if (Tag::setof($tag, $response, "direct_message")) { $re = $status->hash(); $obj = new self(); $obj->sender(TwitterUser::parse($re["sender"])); $obj->recipient(TwitterUser::parse($re["recipient"])); unset($re["recipient"], $re["sender"]); return $obj->cp($re); } throw new Exception("invalid data"); }
/** * ブロックしたユーザを解除する * * @param string $user_id * @return TwitterUser */ public function blocks_destroy($user_id) { $this->do_post("blocks/destroy/" . $user_id . ".xml"); return TwitterUser::parse($this->body()); }