Created
September 7, 2011 05:54
-
-
Save fetus-hina/1199879 to your computer and use it in GitHub Desktop.
FC2 他 metaWeblog API 対応ブログ用 API 投稿サンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
require_once('Zend/XmlRpc/Client.php'); | |
require_once('Zend/Date.php'); | |
define('BLOG_ID', '0'); // 何でもOK? | |
define('USERNAME', '********'); | |
define('PASSWORD', '********'); | |
$client = new Zend_XmlRpc_Client('http://blog.fc2.com/xmlrpc.php'); | |
$result = | |
$client->call( | |
'metaWeblog.newPost', | |
array( | |
BLOG_ID, | |
USERNAME, | |
PASSWORD, | |
array( | |
'title' => 'タイトル', | |
'description' => '本文<br>本文', | |
'mt_text_more' => '続き', | |
'dateCreated' => Zend_Date::now()), | |
true)); // publish:boolean | |
var_dump($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment