忍者ブログ
ThIs SiTe Is A TyPo AnD A BuG.

[PR]

ソーシャルブックマークに追加:ブックマークに追加する
Category :
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

[php][xmlrpc]忍者ブログに外部から記事を投稿してみる。

ソーシャルブックマークに追加:ブックマークに追加する

忍者ブログはxmlrpcが使えるということなので、
やってみました。

---------------------------------------------------------------------------------------
///////////////////////////////////////////////
//個別設定//
///////////////////////////////////////////////

$user = "ブログのURLからhttp://を消したやつ";//例:stl.blog.shinobi.jp
$host = "ブログのURL";
//例:http://stl.blog.shinobi.jp/
$xmlrpc_passwd = "ユーザ情報の変更の記事投稿用パスワード";
///////////////////////////////////////////////
$xmlrpc_path = "/XMLRPC/";
$port = 80;
///////////////////////////////////////////////

//PearのXMLRPCパッケージを読み込む
require_once("XML/RPC.php");

//XMLRPC文字コードを設定
$GLOBALS['XML_RPC_defencoding'] = "UTF-8";

//XMLRPCクライアントの作成
$Client = new XML_RPC_client( $xmlrpc_path, $host, $port );

//appkey:忍者ブログは空で。
$appkey = new XML_RPC_Value( '', 'string' );

//appkey:忍者ブログは1で。
$blogid = new XML_RPC_Value( 1, 'string');

//ユーザ名作成
$username = new XML_RPC_Value( $user, 'string' );

//パスワード作成
$passwd = new XML_RPC_Value( $xmlrpc_passwd, 'string' );

//コンテンツ作成
$content = new XML_RPC_Value(array(
'title'=> new XML_RPC_Value($t, 'string'),
'description'=> new XML_RPC_Value($d, 'string'),
'dateCreated'=> new XML_RPC_Value(date("Ymd\TH:i:s",time()), 'dateTime.iso8601')
), 'struct');

//パブリッシュのフラグ作成
$publish = new XML_RPC_Value( 1, 'boolean');

//XML-RPCメソッドのセット
$Message = new XML_RPC_Message(
'metaWeblog.newPost',
array($blogid, $username, $passwd, $content, $publish) );

//メッセージ送信
$res = $Client->send($Message);

//お帰り。
return $res;

---------------------------------------------------------------------------------------

と、こんな感じ。

PR
この記事にコメントする
NAME:
TITLE:
MAIL:
URL:
COMMENT:
PASS: Vodafone絵文字 i-mode絵文字 Ezweb絵文字
amily
vUVT4C flgoey72FdAa1nc830fNdKu
amily URL 2009/03/05(Thu)05:01:41 EDIT | RES
Free tattoo designs
Want tattoo design ? Visit: <a href=http://tattoos4everybody.com>Tattoo designs</a>. Thousends of tattoo designs waiting for you !
freetattoodesigns URL 2011/02/07(Mon)15:29:24 EDIT | RES
bad credit vehicle loan, car loan calc
wyoming student loan corporation personal loan illinois. how to get student loans, <a href=http://lowcreditpersonalloans.com/>student loans with bad credit</a>. debt reduction loan loans in minnesota.

bad credit history loan buy loans. tennessee payday loan. student loan federal mortgage loan rates california.
GetGrotteGOOB 2011/11/03(Thu)21:06:44 EDIT | RES
texas b on time loan, auto loans nashville
bankruptcy mortgage loans usda rural housing loan. inventory loans, <a href=http://easypaydayloansonline.co.uk/content/payday-loans-uk-get-quick-cash-assist>instant loans online</a>. purpose loan online mortgage loan application.

excel loan amortization template fha house loan. best equity home loan rate. loan terms used automobile loans.
LymnWeepJem 2011/11/10(Thu)03:00:29 EDIT | RES
monthly loan payment calculator, college loan forgiveness
texas payday loan, stafford loan lenders. loans ccjs, <a href=http://easypaydayloansonline.co.uk/>payday loans uk</a>. car loans with poor credit loan for small business.

home loan rate comparison bad credit second mortgage loans. mortgage loan calculator amortization. what is a jumbo loan car loan rate.
LymnWeepJem 2011/11/10(Thu)04:28:52 EDIT | RES
bright green home loans, william d ford direct loan
loan oklahoma, chase auto loans. guaranteed car loans, <a href=http://24paydayloansonline.com/content/virginia-rules-relating-payday>payday loans in virginia</a>. cash advance loan utah general loan.

doctor loans home purchase loan. fast secured loans. automobile title loans loan now.
LymnWeepJem 2011/11/10(Thu)05:54:28 EDIT | RES
alliance and leicester car insurance, car insurance high performance uk
insurance auto resales access car insurance. auto insurance and homeowners insurance, <a href=http://autoinsuranceonlineusa.com/>cheap car insurance plans</a>. tallahassee auto insurance quote insurance for classic car.

used car toronto car insurance rate juneau car insurance. free free car insurance online quote. nj car insurance car company insurance look for compare car insurance uk.
LymnWeepJem 2011/11/10(Thu)08:24:38 EDIT | RES
gravura in lemn
<a href=http://www.laser-tech.org>aparat gravat</a>
Bermeo6928 2011/11/13(Sun)19:44:52 EDIT | RES
pay bill aig car insurance, progressive auto insurance logo
daihatsu used cars insurance, auto insurance half moon bay. 76012 auto insurance texas, <a href=http://autoinsuranceonlineusa.com/category/car-insurance-articles/auto-insurance-female/>mercury auto insurance california</a>. us instant cheap auto insurance quotes, auto insurance consumer complaints.

car g group guide insurance polo, insurance travelers company auto car. alaska auto insurance company. auto insurance consumer reviews auto insurance rate stability act 1996.
LymnWeepJem 2011/11/23(Wed)09:29:30 EDIT | RES
この記事へのトラックバック
この記事にトラックバックする:
MA3楽天賞受賞
ありがとうございます。mash up award 3rdでカラフル.jpが楽天賞を頂きました。
PR
最新コメント
[12/12 poefoffirmvop]
[12/12 Beencerek]
[12/12 ecnaccounts]
[12/11 Kimineami]
[12/11 Kimineami]
カレンダー
04 2017/05 06
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
あわせて読みたい
あわせて読みたい
なかのひと
なかのひと
ブログ内検索
ログール
TrackWord
アクセス解析
このページのQRコード
Copyright © .☆★ ステレオタイプラボ ★☆. 。All Rights Reserved.
忍者ブログ[PR]