开发者

send post include text and image by xmlrpc to wordpress

开发者 https://www.devze.com 2023-03-21 04:39 出处:网络
Im looking for a way to send remotely content(text and image ) by xmlrpc to wordpress but i couldn\'t find yet, im going to sent remotely content (text and image) over 100 post per 开发者_如何学JAVAmi

Im looking for a way to send remotely content(text and image ) by xmlrpc to wordpress but i couldn't find yet, im going to sent remotely content (text and image) over 100 post per 开发者_如何学JAVAminute to wordpress, whats the best way to do it? thanks so much


Use XMLRPC. Something like this:

$params = array(0,$username,$password,$content,true);
$request = xmlrpc_encode_request('metaWeblog.newPost',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_URL, $rpcurl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
$results = curl_exec($ch);
curl_close($ch);
0

精彩评论

暂无评论...
验证码 换一张
取 消