{"id":1701,"date":"2012-05-31T11:52:03","date_gmt":"2012-05-31T02:52:03","guid":{"rendered":"http:\/\/peta.okechan.net\/blog\/?p=1701"},"modified":"2012-05-31T16:24:23","modified_gmt":"2012-05-31T07:24:23","slug":"%e6%9c%80%e6%96%b0%e7%89%88%e3%81%aepython-wordpress-xmlrpc%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/1701","title":{"rendered":"\u6700\u65b0\u7248\u306epython-wordpress-xmlrpc\u3092\u4f7f\u3046"},"content":{"rendered":"<p>\u3053\u3053\u306b\u8a18\u4e8b\u3092\u6295\u7a3f\u3059\u308b\u3068\u304d\u306b\u3001\u4eca\u307e\u3067strong\u30bf\u30b0\u3092\u304b\u306a\u308a\u591a\u7528\u3057\u3066\u307e\u3057\u305f\u3002<br \/>\n\u5927\u6614\u306b\u300cstrong\u30bf\u30b0\u3092\u591a\u7528\u3059\u308b\u3068SEO\u7684\u306b\u4e0d\u5229\u3060\u3088\u300d\u3063\u3066\u8a71\u306f\u805e\u3044\u305f\u3053\u3068\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u305d\u3093\u306a\u306e\u306f\u5225\u306b\u3069\u3046\u3067\u3082\u826f\u304f\u3066\u3001\u6c17\u306b\u306a\u308b\u306e\u306fstrong\u30bf\u30b0\u306e\u7528\u9014\u3092\u7d71\u4e00\u3057\u3066\u306a\u304b\u3063\u305f\u3053\u3068\u3067\u3059\u3002<br \/>\n\u5358\u306b\u592a\u5b57\u306b\u3059\u308b\u306e\u306b\u4f7f\u3063\u305f\u308a\u3001\u898b\u51fa\u3057\u306e\u305f\u3081\u306b\u4f7f\u3063\u305f\u308a\u3068\u7528\u9014\u304c\u307e\u3061\u307e\u3061\u3067\u3057\u305f\u3002<br \/>\n\u3053\u308c\u3067\u306fCSS\u3067\u898b\u305f\u76ee\u3092\u8abf\u6574\u3057\u3065\u3089\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3046\u3061\u306e\u30d6\u30ed\u30b0\u306fstrong\u30bf\u30b0\u3092\u898b\u51fa\u3057\u3068\u3057\u3066\u4f7f\u3063\u3066\u308b\u30d1\u30bf\u30fc\u30f3\u304c\u4e00\u756a\u591a\u3044\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305astrong\u30bf\u30b0\u3092h3\u30bf\u30b0\u306b\u5909\u63db\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092Python\u3067\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\n\u4ee5\u524d\u540c\u3058\u3088\u3046\u306a\u4e8b\u3092\u3084\u3063\u305f\u6642\u3068\u540c\u3058\u304f\u4f7f\u3044\u6368\u3066\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306a\u306e\u3067\u304b\u306a\u308a\u9069\u5f53\u306a\u66f8\u304d\u65b9\u3092\u3057\u3066\u307e\u3059\u3002<\/p>\n<h3>\u8ffd\u8a18<\/h3>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u306e\u3067\u4f7f\u308f\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u8a73\u7d30\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#! \/usr\/bin\/env python\r\n# -*- coding: utf8  -*-\r\n\r\nimport sys\r\nimport codecs\r\nsys.stdout = codecs.getwriter('utf_8')(sys.stdout)\r\n\r\nimport re \r\nfrom datetime import datetime, timedelta\r\nfrom wordpress_xmlrpc import Client, WordPressPost\r\nfrom wordpress_xmlrpc.methods.posts import GetPosts, EditPost\r\n\r\nwordpress = &quot;http:\/\/example.com\/xmlrpc.php&quot;\r\nuser = &quot;&quot;\r\npassword = &quot;&quot;\r\n\r\nstrong_begin = '&lt;strong&gt;'\r\nstrong_end = '&lt;\/strong&gt;'\r\nh3_begin = '&lt;h3&gt;'\r\nh3_end = '&lt;\/h3&gt;'\r\n \r\nwp = Client(wordpress, user, password)\r\n\r\ndef getRecentGenerator():\r\n    offset = 0\r\n    number = 20\r\n    while True:\r\n        posts = wp.call(GetPosts({'number': number, 'offset': offset}))\r\n        if len(posts) == 0:\r\n            break\r\n        for post in posts:\r\n            yield post\r\n        offset += number\r\n \r\nfor post in getRecentGenerator():\r\n    if post.content.find(strong_begin) &gt;= 0 and post.content.find(strong_end) &gt;= 0:\r\n        print post.date_modified\r\n\r\n        post.content = post.content.replace(strong_begin, h3_begin)\r\n        post.content = post.content.replace(strong_end, h3_end)\r\n        \r\n        print post.link\r\n        print 'Editing %s' % post.title\r\n        if raw_input(u'y\u3067\u7d9a\u884c: ') == 'y':\r\n            wp.call(EditPost(post.id, post))\r\n            print 'Done'\r\n        else:\r\n            print 'Canceled'\r\n    else:\r\n        print 'Skipped %s' % post.title<\/pre>\n<p>\u5168\u8a18\u4e8b\u3092\u8abf\u3079\u306a\u304c\u3089\u3001\u672c\u6587\u306bstrong\u30bf\u30b0\u304c\u542b\u307e\u308c\u308b\u8a18\u4e8b\u304c\u3042\u3063\u305f\u3089\u3001\u305d\u306e\u8a18\u4e8b\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u3068\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a\u3057\u3064\u3064\u5b9f\u884c\u3059\u308b\u304b\u30e6\u30fc\u30b6\u306b\u78ba\u8a8d\u3092\u6c42\u3081\u307e\u3059\u3002<br \/>\n\u5358\u306b\u592a\u5b57\u3068\u3057\u3066strong\u3092\u4f7f\u3063\u3066\u308b\u90e8\u5206\u307e\u3067h3\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u78ba\u8a8d\u304c\u5fc5\u8981\u306a\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>1\u56de\u51e6\u7406\u304c\u7d42\u308f\u3063\u305f\u3089\u4eca\u5ea6\u306fstrong\u3092b\u30bf\u30b0\u306b\u66f8\u304d\u63db\u3048\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u5b9f\u884c\u3059\u308b\u3068\u3044\u3044\u611f\u3058\u3067\u3057\u305f\u3002<\/p>\n<p>\u3053\u3093\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3001\u30cb\u30c3\u30c1\u904e\u304e\u3066\u4f7f\u3046\u4eba\u306f\u3044\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001<a href=\"https:\/\/github.com\/maxcutler\/python-wordpress-xmlrpc\" target=\"_blank\">python-wordpress-xmlrpc<\/a>\u306b\u304b\u306a\u308a\u5909\u66f4\u304c\u3042\u3063\u3066\u4f7f\u3044\u65b9\u304c\u5909\u308f\u3063\u305f\u306e\u3067\u3001\u4f7f\u3044\u65b9\u306e\u30b5\u30f3\u30d7\u30eb\u306b\u306a\u308c\u3070\u3068\u601d\u3044\u8f09\u305b\u307e\u3057\u305f\u3002<br \/>\npython-wordpress-xmlrpc\u306e\u4ed5\u69d8\u304c\u5909\u308f\u3063\u305f\u3068\u3044\u3046\u3088\u308aWordPress\u306eXML-RPC\u306eAPI\u304c3.4\u3067\u7d50\u69cb\u5909\u308f\u308b\u3089\u3057\u304f\u3001python-wordpress-xmlrpc\u306f\u305d\u308c\u306b\u8ffd\u5f93\u3057\u305f\u5f62\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>WordPress 3.4\u306f\u307e\u3060beta\u306a\u306e\u306b\u5bfe\u5fdc\u65e9\u3044\u306a\u3041\u3002<br \/>\n\u4eca\u56de\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u591a\u5206WordPress 3.4\u3058\u3083\u306a\u3044\u3068\u52d5\u4f5c\u3057\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\uff08wp.getPosts API\u306f3.4\u304b\u3089\u306a\u306e\u3067\uff09<\/p>\n<h3>\u8ffd\u8a18<\/h3>\n<p>python-wordpress-xmlrpc\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3068\u3001\u6587\u5b57\u5217\u304c\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u305f\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3053\u308c\u81ea\u4f53\u306f\u3084\u308a\u53d6\u308a\u306bXML\u3092\u4f7f\u3063\u3066\u308b\u4ee5\u4e0a\u4ed5\u65b9\u306e\u306a\u3044\u3053\u3068\u3067\u306f\u3042\u308a\u307e\u3059\u3002\uff09<br \/>\n\u3053\u308c\u3092\u305d\u306e\u307e\u307eEditPost\u3059\u308b\u3060\u3051\u30671\u6bb5\u968e\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u9032\u3080\uff08\u3046\u307e\u3044\u8868\u73fe\u304c\u601d\u3044\u6d6e\u304b\u3070\u306a\u3044\uff09\u3053\u3068\u306b\u306a\u308a\u3001\u4f8b\u3048\u3070\u672c\u6587\u306b\u300cR &amp; B\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u5165\u3063\u3066\u308b\u3068\u300cR &amp;amp; B\u300d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4f55\u5ea6\u3082\u7e70\u308a\u8fd4\u3059\u3068\u91cd\u306d\u304c\u3051\u3057\u305f\u72b6\u614b\u306b\u306a\u308a\u3001\u300cR &amp;amp;amp;amp;amp;amp; B\u300d\u3068\u304b\u306b\u306a\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u7aef\u7684\u306b\u8a00\u3046\u3068\u3001\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u306e\u5185\u5bb9\u304c\u58ca\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u901a\u5e38\u3053\u306e\u7a0b\u5ea6\u306e\u3053\u3068\u306funescape\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u56de\u907f\u51fa\u6765\u308b\u3093\u3067\u3059\u304c\u3001\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u308b\u306e\u304c\u3069\u3046\u3082\u300c&amp;, &gt;, &lt;, &quot;\u300d\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4e00\u90e8\u306e\u8a18\u53f7\u3082\u6570\u5024\u6587\u5b57\u53c2\u7167\u306b\u5909\u63db\u3055\u308c\u308b\u307f\u305f\u3044\u3067\u3001\u3069\u3053\u307e\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u308b\u306e\u304b\u6b63\u78ba\u306a\u3068\u3053\u308d\u3092\u8abf\u67fb\u3059\u308b\u306f\u5927\u5909\u3068\u3044\u3046\u7d50\u8ad6\u306b\u9054\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u306e\u3067\u79c1\u3082\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u76f4\u524d\u306e\u72b6\u614b\u306bWordPress\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304b\u3089\u5fa9\u5143\u3057\u3066\u3001\u76f4\u63a5\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3084\u308a\u76f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u3055\u3089\u306b\u8ffd\u8a18<\/h3>\n<p>\u4eca\u56de\u306e\u305a\u3063\u3068\u524d\u306bpython-wordpress-xmlrpc\u3092\u4f7f\u3063\u305f\u3068\u304d\u306b\u7de8\u96c6\u3057\u305f\u8a18\u4e8b\u304c\u3044\u304f\u3064\u304b\u6b8b\u3063\u3066\u308b\u306e\u306b\u6c17\u304c\u4ed8\u304d\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u3068\u306a\u3063\u3066\u306f\u5f53\u6642\u306e\u5206\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304b\u3089\u623b\u3059\u306e\u306f\u5927\u5909\u306a\u306e\u3067\u3001\u30a2\u30f3\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u65b9\u6cd5\u3092\u8272\u3005\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import HTMLParser\r\n# text\u306b\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u305f\u6587\u5b57\u5217\u304c\u5165\u3063\u3066\u308b\u3068\u3057\u3066\r\ntext = HTMLParser.HTMLParser().unescape(text)<\/pre>\n<p>\u3067\u884c\u3051\u305d\u3046\u3060\u3063\u305f\u306e\u3067Python\u304b\u3089DB\u306b\u63a5\u7d9a\u3057\u3066\u4fee\u6b63\u3057\u3068\u304d\u307e\u3057\u305f\u3002<br \/>\n\u8abf\u67fb\u306e\u904e\u7a0b\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u306e\u3055\u308c\u5177\u5408\u3092\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u3001\u3072\u3068\u3064\u306e\u8a18\u4e8b\u5185\u3067\u3082\u591a\u3081\u306b\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u3066\u3044\u308b\u90e8\u5206\u3068\u305d\u3046\u3067\u306a\u3044\u90e8\u5206\u304c\u3042\u3063\u3066\u3001WordPress\u306e\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u5185\u90e8\u3060\u3051\u304c\u591a\u3081\u306b\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u3066\u308b\u3088\u3046\u3067\u3057\u305f\u3002<br \/>\n\u4e00\u5fdc\u6b63\u898f\u8868\u73fe\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u6a5f\u68b0\u7684\u306b\u7f6e\u63db\u51fa\u6765\u307e\u3057\u305f\u304c\u3001\u306a\u305c\u305d\u3046\u3044\u3046\u75c7\u72b6\u304c\u51fa\u305f\u306e\u304b\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3053\u306b\u8a18\u4e8b\u3092\u6295\u7a3f\u3059\u308b\u3068\u304d\u306b\u3001\u4eca\u307e\u3067strong\u30bf\u30b0\u3092\u304b\u306a\u308a\u591a\u7528\u3057\u3066\u307e\u3057\u305f\u3002<br \/>\n\u5927\u6614\u306b\u300cstrong\u30bf\u30b0\u3092\u591a\u7528\u3059\u308b\u3068SEO\u7684\u306b\u4e0d\u5229\u3060\u3088\u300d\u3063\u3066\u8a71\u306f\u805e\u3044\u305f\u3053\u3068\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u305d\u3093\u306a\u306e\u306f\u5225\u306b\u3069\u3046\u3067\u3082\u826f\u304f\u3066\u3001\u6c17\u306b\u306a\u308b\u306e\u306fstrong\u30bf\u30b0\u306e\u7528\u9014\u3092\u7d71\u4e00\u3057\u3066\u306a\u304b\u3063\u305f\u3053\u3068\u3067\u3059\u3002<br \/>\n\u5358\u306b\u592a\u5b57\u306b\u3059\u308b\u306e\u306b\u4f7f\u3063\u305f\u308a\u3001\u898b\u51fa\u3057\u306e\u305f\u3081\u306b\u4f7f\u3063\u305f\u308a\u3068\u7528\u9014\u304c\u307e\u3061\u307e\u3061\u3067\u3057\u305f\u3002<br \/>\n\u3053\u308c\u3067\u306fCSS\u3067\u898b\u305f\u76ee\u3092\u8abf\u6574\u3057\u3065\u3089\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3046\u3061\u306e\u30d6\u30ed\u30b0\u306fstrong\u30bf\u30b0\u3092\u898b\u51fa\u3057\u3068\u3057\u3066\u4f7f\u3063\u3066\u308b\u30d1\u30bf\u30fc\u30f3\u304c\u4e00\u756a\u591a\u3044\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305astrong\u30bf\u30b0\u3092h3\u30bf\u30b0\u306b\u5909\u63db\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092Python\u3067\u66f8\u304d\u307e\u3057\u305f\u3002<br \/>\n\u4ee5\u524d\u540c\u3058\u3088\u3046\u306a\u4e8b\u3092\u3084\u3063\u305f\u6642\u3068\u540c\u3058\u304f\u4f7f\u3044\u6368\u3066\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306a\u306e\u3067\u304b\u306a\u308a\u9069\u5f53\u306a\u66f8\u304d\u65b9\u3092\u3057\u3066\u307e\u3059\u3002<\/p>\n<h3>\u8ffd\u8a18<\/h3>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3059\u306e\u3067\u4f7f\u308f\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u8a73\u7d30\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">#! \/usr\/bin\/env python\r\n# -*- coding: utf8  -*-\r\n\r\nimport sys\r\nimport codecs\r\nsys.stdout = codecs.getwriter('utf_8')(sys.stdout)\r\n\r\nimport re \r\nfrom datetime import datetime, timedelta\r\nfrom wordpress_xmlrpc import Client, WordPressPost\r\nfrom wordpress_xmlrpc.methods.posts import GetPosts, EditPost\r\n\r\nwordpress = &quot;http:\/\/example.com\/xmlrpc.php&quot;\r\nuser = &quot;&quot;\r\npassword = &quot;&quot;\r\n\r\nstrong_begin = '&lt;strong&gt;'\r\nstrong_end = '&lt;\/strong&gt;'\r\nh3_begin = '&lt;h3&gt;'\r\nh3_end = '&lt;\/h3&gt;'\r\n \r\nwp = Client(wordpress, user, password)\r\n\r\ndef getRecentGenerator():\r\n    offset = 0\r\n    number = 20\r\n    while True:\r\n        posts = wp.call(GetPosts({'number': number, 'offset': offset}))\r\n        if len(posts) == 0:\r\n            break\r\n        for post in posts:\r\n            yield post\r\n        offset += number\r\n \r\nfor post in getRecentGenerator():\r\n    if post.content.find(strong_begin) &gt;= 0 and post.content.find(strong_end) &gt;= 0:\r\n        print post.date_modified\r\n\r\n        post.content = post.content.replace(strong_begin, h3_begin)\r\n        post.content = post.content.replace(strong_end, h3_end)\r\n        \r\n        print post.link\r\n        print 'Editing %s' % post.title\r\n        if raw_input(u'y\u3067\u7d9a\u884c: ') == 'y':\r\n            wp.call(EditPost(post.id, post))\r\n            print 'Done'\r\n        else:\r\n            print 'Canceled'\r\n    else:\r\n        print 'Skipped %s' % post.title<\/pre>\n<p>\u5168\u8a18\u4e8b\u3092\u8abf\u3079\u306a\u304c\u3089\u3001\u672c\u6587\u306bstrong\u30bf\u30b0\u304c\u542b\u307e\u308c\u308b\u8a18\u4e8b\u304c\u3042\u3063\u305f\u3089\u3001\u305d\u306e\u8a18\u4e8b\u306e\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u3068\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a\u3057\u3064\u3064\u5b9f\u884c\u3059\u308b\u304b\u30e6\u30fc\u30b6\u306b\u78ba\u8a8d\u3092\u6c42\u3081\u307e\u3059\u3002<br \/>\n\u5358\u306b\u592a\u5b57\u3068\u3057\u3066strong\u3092\u4f7f\u3063\u3066\u308b\u90e8\u5206\u307e\u3067h3\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u78ba\u8a8d\u304c\u5fc5\u8981\u306a\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>1\u56de\u51e6\u7406\u304c\u7d42\u308f\u3063\u305f\u3089\u4eca\u5ea6\u306fstrong\u3092b\u30bf\u30b0\u306b\u66f8\u304d\u63db\u3048\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u5b9f\u884c\u3059\u308b\u3068\u3044\u3044\u611f\u3058\u3067\u3057\u305f\u3002<\/p>\n<p>\u3053\u3093\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3001\u30cb\u30c3\u30c1\u904e\u304e\u3066\u4f7f\u3046\u4eba\u306f\u3044\u306a\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001<a href=\"https:\/\/github.com\/maxcutler\/python-wordpress-xmlrpc\" target=\"_blank\">python-wordpress-xmlrpc<\/a>\u306b\u304b\u306a\u308a\u5909\u66f4\u304c\u3042\u3063\u3066\u4f7f\u3044\u65b9\u304c\u5909\u308f\u3063\u305f\u306e\u3067\u3001\u4f7f\u3044\u65b9\u306e\u30b5\u30f3\u30d7\u30eb\u306b\u306a\u308c\u3070\u3068\u601d\u3044\u8f09\u305b\u307e\u3057\u305f\u3002<br \/>\npython-wordpress-xmlrpc\u306e\u4ed5\u69d8\u304c\u5909\u308f\u3063\u305f\u3068\u3044\u3046\u3088\u308aWordPress\u306eXML-RPC\u306eAPI\u304c3.4\u3067\u7d50\u69cb\u5909\u308f\u308b\u3089\u3057\u304f\u3001python-wordpress-xmlrpc\u306f\u305d\u308c\u306b\u8ffd\u5f93\u3057\u305f\u5f62\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>WordPress 3.4\u306f\u307e\u3060beta\u306a\u306e\u306b\u5bfe\u5fdc\u65e9\u3044\u306a\u3041\u3002<br \/>\n\u4eca\u56de\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u591a\u5206WordPress 3.4\u3058\u3083\u306a\u3044\u3068\u52d5\u4f5c\u3057\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\uff08wp.getPosts API\u306f3.4\u304b\u3089\u306a\u306e\u3067\uff09<\/p>\n<h3>\u8ffd\u8a18<\/h3>\n<p>python-wordpress-xmlrpc\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3068\u3001\u6587\u5b57\u5217\u304c\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u305f\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3053\u308c\u81ea\u4f53\u306f\u3084\u308a\u53d6\u308a\u306bXML\u3092\u4f7f\u3063\u3066\u308b\u4ee5\u4e0a\u4ed5\u65b9\u306e\u306a\u3044\u3053\u3068\u3067\u306f\u3042\u308a\u307e\u3059\u3002\uff09<br \/>\n\u3053\u308c\u3092\u305d\u306e\u307e\u307eEditPost\u3059\u308b\u3060\u3051\u30671\u6bb5\u968e\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u9032\u3080\uff08\u3046\u307e\u3044\u8868\u73fe\u304c\u601d\u3044\u6d6e\u304b\u3070\u306a\u3044\uff09\u3053\u3068\u306b\u306a\u308a\u3001\u4f8b\u3048\u3070\u672c\u6587\u306b\u300cR &amp; B\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u5165\u3063\u3066\u308b\u3068\u300cR &amp;amp; B\u300d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4f55\u5ea6\u3082\u7e70\u308a\u8fd4\u3059\u3068\u91cd\u306d\u304c\u3051\u3057\u305f\u72b6\u614b\u306b\u306a\u308a\u3001\u300cR &amp;amp;amp;amp;amp;amp; B\u300d\u3068\u304b\u306b\u306a\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u7aef\u7684\u306b\u8a00\u3046\u3068\u3001\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u306e\u5185\u5bb9\u304c\u58ca\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u901a\u5e38\u3053\u306e\u7a0b\u5ea6\u306e\u3053\u3068\u306funescape\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u56de\u907f\u51fa\u6765\u308b\u3093\u3067\u3059\u304c\u3001\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u308b\u306e\u304c\u3069\u3046\u3082\u300c&amp;, &gt;, &lt;, &quot;\u300d\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u4e00\u90e8\u306e\u8a18\u53f7\u3082\u6570\u5024\u6587\u5b57\u53c2\u7167\u306b\u5909\u63db\u3055\u308c\u308b\u307f\u305f\u3044\u3067\u3001\u3069\u3053\u307e\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u308b\u306e\u304b\u6b63\u78ba\u306a\u3068\u3053\u308d\u3092\u8abf\u67fb\u3059\u308b\u306f\u5927\u5909\u3068\u3044\u3046\u7d50\u8ad6\u306b\u9054\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u306e\u3067\u79c1\u3082\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u76f4\u524d\u306e\u72b6\u614b\u306bWordPress\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304b\u3089\u5fa9\u5143\u3057\u3066\u3001\u76f4\u63a5\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u5909\u66f4\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3084\u308a\u76f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3>\u3055\u3089\u306b\u8ffd\u8a18<\/h3>\n<p>\u4eca\u56de\u306e\u305a\u3063\u3068\u524d\u306bpython-wordpress-xmlrpc\u3092\u4f7f\u3063\u305f\u3068\u304d\u306b\u7de8\u96c6\u3057\u305f\u8a18\u4e8b\u304c\u3044\u304f\u3064\u304b\u6b8b\u3063\u3066\u308b\u306e\u306b\u6c17\u304c\u4ed8\u304d\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u3068\u306a\u3063\u3066\u306f\u5f53\u6642\u306e\u5206\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304b\u3089\u623b\u3059\u306e\u306f\u5927\u5909\u306a\u306e\u3067\u3001\u30a2\u30f3\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u65b9\u6cd5\u3092\u8272\u3005\u8a66\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">import HTMLParser\r\n# text\u306b\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u305f\u6587\u5b57\u5217\u304c\u5165\u3063\u3066\u308b\u3068\u3057\u3066\r\ntext = HTMLParser.HTMLParser().unescape(text)<\/pre>\n<p>\u3067\u884c\u3051\u305d\u3046\u3060\u3063\u305f\u306e\u3067Python\u304b\u3089DB\u306b\u63a5\u7d9a\u3057\u3066\u4fee\u6b63\u3057\u3068\u304d\u307e\u3057\u305f\u3002<br \/>\n\u8abf\u67fb\u306e\u904e\u7a0b\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u306e\u3055\u308c\u5177\u5408\u3092\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u3001\u3072\u3068\u3064\u306e\u8a18\u4e8b\u5185\u3067\u3082\u591a\u3081\u306b\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u3066\u3044\u308b\u90e8\u5206\u3068\u305d\u3046\u3067\u306a\u3044\u90e8\u5206\u304c\u3042\u3063\u3066\u3001WordPress\u306e\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u5185\u90e8\u3060\u3051\u304c\u591a\u3081\u306b\u30a8\u30b9\u30b1\u30fc\u30d7\u3055\u308c\u3066\u308b\u3088\u3046\u3067\u3057\u305f\u3002<br \/>\n\u4e00\u5fdc\u6b63\u898f\u8868\u73fe\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u6a5f\u68b0\u7684\u306b\u7f6e\u63db\u51fa\u6765\u307e\u3057\u305f\u304c\u3001\u306a\u305c\u305d\u3046\u3044\u3046\u75c7\u72b6\u304c\u51fa\u305f\u306e\u304b\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[60,420,61],"class_list":["post-1701","post","type-post","status-publish","format-standard","hentry","category-tech","tag-python","tag-python-wordpress-xmlrpc","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/1701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=1701"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/1701\/revisions"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=1701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=1701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=1701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}