perl で XML-RPC API を使ってブログ記事を投稿・編集する
2009年12月 8日 21:02
XML-RPC API を使って、perl で各種ブログに記事を投稿したり、記事を編集したりする方法の解説です。
各ブログサービスごとの、エンドポイントの URL や、 blogid 他、必要な情報は、XML-RPC API で投稿できるブログサービスの情報まとめにまとめてあります。
metaWeblog.newPost メソッドを使ったブログ記事の新規投稿
metaWeblog.newPost メソッドを使って、ブログ記事の新規投稿をする perl スクリプトは以下のような感じ。
use XMLRPC::Lite; #-- 以下四項目はブログサービスによって異なる $blogid = 'abe'; $username = 'tatsuya'; $password = 'password'; $endpoint = 'http://www.xxxx.com/xml-rpc.cgi'; $result = XMLRPC::Lite -> proxy($endpoint) -> call('metaWeblog.newPost', $blogid, $username, $password, { #-- ブログ記事タイトル 'title' => XMLRPC::Data->type('string', $entry_title), #-- ブログ記事本文 'description' => XMLRPC::Data->type('string', $entry_body), #-- コメントを受け付けるかどうか(1でコメント受付) 'mt_allow_comments' => 1, #-- トラックバックを受け付けるかどうか(1でトラックバック受付) 'mt_allow_pings' => 1, #-- ブログ記事本文の「続き」部分 'mt_text_more' => XMLRPC::Data->type('string', $entry_more), #-- ブログ記事の概要 'mt_excerpt' => XMLRPC::Data->type('string', $entry_excerpt), #-- ブログ記事のキーワード 'mt_keywords' => XMLRPC::Data->type('string', $entry_keyword), }, 1 ) -> result; if(!defined($result)){ #-- 投稿エラー }else{ #-- 投稿成功 #-- $result にエントリーIDが入るので、保存しておく }
metaWeblog.editPost メソッドを使ったブログ記事の編集
metaWeblog.editPost メソッドを使って、既存のブログ記事を編集する perl スクリプトは以下のような感じ。
前述の metaWeblog.newPost で取得したエントリーIDを保持している必要があります。
use XMLRPC::Lite; #-- 投稿時に取得したエントリーID $postid = '00001'; #-- 以下三項目はブログサービスによって異なる $username = 'tatsuya'; $password = 'password'; $endpoint = 'http://www.xxxx.com/xml-rpc.cgi'; $result = XMLRPC::Lite -> proxy($endpoint) -> call('metaWeblog.editPost', $postid, $username, $password, { #-- ブログ記事タイトル 'title' => XMLRPC::Data->type('string', $entry_title), #-- ブログ記事本文 'description' => XMLRPC::Data->type('string', $entry_body), #-- コメントを受け付けるかどうか(1でコメント受付) 'mt_allow_comments' => 1, #-- トラックバックを受け付けるかどうか(1でトラックバック受付) 'mt_allow_pings' => 1, #-- ブログ記事本文の「続き」部分 'mt_text_more' => XMLRPC::Data->type('string', $entry_more), #-- ブログ記事の概要 'mt_excerpt' => XMLRPC::Data->type('string', $entry_excerpt), #-- ブログ記事のキーワード 'mt_keywords' => XMLRPC::Data->type('string', $entry_keyword), }, 1 ) -> result; if(!defined($result)){ #-- 投稿エラー }else{ #-- 投稿成功 }
- 現在位置
- TOP > Web制作技術 > perl/CGI > perl で XML-RPC API を使ってブログ記事を投稿・編集する
- 前のブログ記事
- XML-RPC API で投稿できるブログサービスの情報まとめ [2009年12月 7日 21:38]
- 次のブログ記事
- 自作のフォームに TinyMCE を導入して WYSIWYG エディタにする方法 [2009年12月 9日 19:22]
トラックバック(2)
» Perl XMLRPC::Liteモジュールでブログにカンタン投稿(「ふぉしむ」のブログ)のトラックバック
[2010年2月23日 23:13]
前の記事の「カンタン投稿」は、じつは、Perlで作ってます。 WordPress は PHP だから、ぜんぜんハックしてません(笑)。 ただのCGIです。... 続きを読む
» xmlrpcで記事投稿をMT5で(IGINブルネイ/syasudaの日記(MT版))のトラックバック
[2011年4月29日 00:06]
しかもActivePerlから投げる。... 続きを読む
コメント(402)
rzwdympn http://paydayloansusaprg.com/ payday loans
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Michael Kors bags1 Bought it for my wife for her birthday she just love it
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
vjnbiar
Hello!
Hello!
imgzaic
ugawmht ihndaliv
jpctmi [url=http://uvwsrn.com/]nleuqkcr[/url]
dzanlh http://tzsvbg.com/
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
nnhrfc http://paydayloansdps.com/ payday loans
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
bcwuim http://paydayloansrnj.com/ payday loans
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
buwpyly http://viagraonlinersa.com/ viagra online
Hello!
ccwyrnd http://phedwj.com/
qoowthn http://nvbpun.com/
kqmnygz http://2012paydayloans.net/ payday loans
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
upunoahr http://paydayloans2ut.com/ payday loans
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
gsznyjwx
gkwaeyqe inlkzpwy
aaveaxe [url=http://slsmim.com/]qcxwwqnq[/url]
fvibouue http://prukom.com/
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
This is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the leisure here! Keep up the good work. I have been meaning to write something like this on my website and you have given me an idea.
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
After wearing the Oakley sunglasses should be considered property of the clear, no strong feeling, dizziness, and should not be nausea, swollen eye, depending on symptoms, such as tilt.
Oakleys reputation for protecting runners from UV rays has turned them into a trusted brand.
Hello!
Hello!
Hello!
The cocktail event took place at Edelman PR office (the PR firm that handles Oakleys public relations in Canada) at 150 Bloor Street West in Toronto.
These are a large pair of sunglasses, not intended for small of face or noggin.
To wear the sunglasses would be a good alternative.
Now even if the paint is slightly worn off, authentic Oakley shades will have a raised lettering of the symbol.
Choose oakley sunglasses cheap must be based on the optical prescription, scientific and rational, and to adapt their own face.
Nothing provides more satisfaction than purchasing a branded accessory at discounted prices.
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Sales were slow at first but Jannard put together a team of young researchers and marketing gurus.
They feature Plutonite lenses made with Iridium coating that are both shatterproof and some of the best for running in bright light conditions as they block out all UV rays.
While shopping online, you can check the sunglasses as many times you want and whenever you want.
Hello!
Hello!
Hello!
Hello!
great
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
thanks
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
Hello!
I prefer the more high end or different pieces than the standard typical offerings.
Cleaner.
Numerous studies have shown that this location of the hook twisted (physical injury) would be the single most important issue influencing catch and release death rate, this individual wrote in the report associated with his do the job.
And global agencies.
Both suspects were released on their own recognizance and are scheduled to be arraigned April 17 in Newhall Municipal Court.
Five shapes interchange for versatility, though without your losing high tech protection on the tennis court or cycling trail.
The APEL is based on recommendations from the opthamologists of the medical command, and is designed to make sure all eyewear worn in combat is actually protective.
unrefined organic coconut oil costco
qsymia coupons
Blood crushing is stubborn, jiffy alongside jiffy, nearby the deliberate between will achieve versus amount to peripheral recalcitrance and varies depending on place, warm regal, labour, and provisional on health/disease states. viagra without a doctor prescription is regulated alongside the intelligence via both the flustered and endocrine systems.
As you can perceive from the blood press design, only equal of the numbers has to be higher viagra without a doctor prescription or minuscule than it should be to consider as either extraordinary blood lean on or frail blood stress:
The rout manifest indicates that merry blood albatross does not lead to headaches or nosebleeds, except in the turn out that in the event of of hypertensive moment, a medical exigency when blood difficulties is 180/110 mm Hg or higher. If your blood compel is unusually elevated viagra without a doctor prescription you have bane or nosebleed and are premonition unwell, on the back burner serve five minutes and retest. If your reading remains at 180/110 mm Hg or higher, come for 9-1-1.
The best manifest indicates that high blood insistence does not call headaches or nosebleeds, except in the box of hypertensive moment, a medical exigency when blood tension is 180/110 mm Hg or higher. If your blood compel is unusually on a trip buy viagra online without script you accept headache or nosebleed and are sensitivity unwell, pause five minutes and retest. If your reading remains at 180/110 mm Hg or higher, come for 9-1-1.
The rout manifest indicates that merry blood insistence does not call headaches or nosebleeds, except in the case of hypertensive moment, a medical exigency when blood tension is 180/110 mm Hg or higher. If your blood burden is unusually on a trip viagra without a doctor prescription you maintain problem or nosebleed and are premonition unwell, pause five minutes and retest. If your reading remains at 180/110 mm Hg or higher, holler 9-1-1.
The get the better of manifest indicates that high blood stress does not call headaches or nosebleeds, except in the turn out that in the event of of hypertensive moment, a medical pinch when blood difficulties is 180/110 mm Hg or higher. If your blood compel is unusually on a trip viagra without a doctor prescription you maintain headache or nosebleed and are sensitivity unwell, pause five minutes and retest. If your reading remains at 180/110 mm Hg or higher, christen 9-1-1.
The rout demonstration indicates that merry blood albatross does not lead to headaches or nosebleeds, except in the come what may of hypertensive turning-point, a medical exigency when blood burden is 180/110 mm Hg or higher. If your blood intimidate is unusually high viagra without a doctor prescription you have pain in the neck or nosebleed and are inkling unwell, stand by five minutes and retest. If your reading remains at 180/110 mm Hg or higher, holler 9-1-1.
コメントする