echo json_encode($result); // 블로그 API 함수 functionnewPost($title, $description) { $g_blog_url = "https://api.blog.naver.com/xmlrpc"; $user_id = "아이디"; $blogid = "아이디"; $password = "발급받은 비밀번호"; $publish = true; $client = new xmlrpc_client($g_blog_url); $client->setSSLVerifyPeer(false);
$GLOBALS['xmlrpc_internalencoding'] = 'UTF-8';
$struct = [ 'title' => new xmlrpcval($title, "string"), 'description' => new xmlrpcval($description, "string") ];
$f = new xmlrpcmsg("metaWeblog.newPost", [ new xmlrpcval($blogid, "string"), new xmlrpcval($user_id, "string"), new xmlrpcval($password, "string"), new xmlrpcval($struct , "struct"), new xmlrpcval($publish, "boolean") ] );