{"id":53,"date":"2016-02-16T06:23:43","date_gmt":"2016-02-15T21:23:43","guid":{"rendered":"http:\/\/spiralware.jp\/blog\/?p=53"},"modified":"2016-02-16T06:23:43","modified_gmt":"2016-02-15T21:23:43","slug":"%e3%82%a2%e3%83%a1%e3%83%96%e3%83%ad%e3%81%ae%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97%e3%82%92%e5%a7%8b%e3%82%81%e3%81%a6%e3%81%bf%e3%81%be%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/spiralware.jp\/blog\/archives\/53","title":{"rendered":"\u9031\uff11\u56de\u3001\u30a2\u30e1\u30d6\u30ed\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u3066\u3044\u307e\u3059"},"content":{"rendered":"<h2>\u306a\u305c\uff1f<\/h2>\n<p>\u79c1\u306e\u5ac1\u304c\u30a2\u30e1\u30fc\u30d0\u30d6\u30ed\u30b0\uff08\u30a2\u30e1\u30d6\u30ed\uff09\u3092\u3084\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u3064\u3044\u6700\u8fd1\u307e\u3067\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u4e00\u5207\u53d6\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u307e\u3060\u59cb\u3081\u3066\u304b\u3089\uff11\u5e74\u304f\u3089\u3044\u3057\u304b\u7d4c\u3063\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u307b\u307c\u6bce\u65e5\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059\u3002\u3067\u3059\u306e\u3067\u3001\u3053\u306e\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u305f\u3089\u304d\u3063\u3068\u7acb\u3061\u76f4\u308c\u306a\u3044\u3060\u308d\u3046\u306a\u3041\u3001\u3068\u3044\u3046\u304f\u3089\u3044\u306e\u8a18\u4e8b\u6570\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u308b\u3068\u8a00\u3063\u3066\u3082\u3001\u30d6\u30ed\u30b0\u7ba1\u7406\u8005\u304c\u3001\u300c\u30b7\u30b9\u30c6\u30e0\u969c\u5bb3\u767a\u751f\u3002\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304b\u3089\u5fa9\u65e7\u3057\u3088\u3046\u3068\u3057\u307e\u3057\u305f\u304c\u3001\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3001\u3066\u3078\u3063\u3002\u300d\u3068\u91c8\u660e\u3059\u308b\u3088\u3046\u306a\u4e8b\u304c\u3042\u308b\u3068\u306f\u601d\u3063\u3066\u3044\u307e\u305b\u3093\u3057\u3001\u300c\u898f\u7d04\u9055\u53cd\u306b\u3088\u308a\u3001\u3042\u306a\u305f\u306e\u30d6\u30ed\u30b0\u306f\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002\u3054\u6101\u50b7\u69d8\u3067\u3059\u3002\u300d\u3044\u3046\u80cc\u7b4b\u306e\u51cd\u308b\u544a\u77e5\u3092\u53d7\u3051\u308b\u4e8b\u3082\u306a\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u79c1\u304c\u5fc3\u914d\u3057\u3066\u3044\u308b\u306e\u306f\u3001\uff13\u6b73\u306e\u606f\u5b50\u304c\u5ac1\u306e\u30b9\u30de\u30db\u3092\u52dd\u624b\u306b\u3044\u3058\u3063\u3066\u30d6\u30ed\u30b0\u9589\u9396\u3057\u3066\u3057\u307e\u3046\u3060\u3068\u304b\u3001\u5ac1\u304c\u8aa4\u64cd\u4f5c\u3057\u3066\u9055\u3046\u8a18\u4e8b\u3092\u6d88\u3057\u3066\u3057\u307e\u3046\u3068\u3044\u3063\u305f\u30b1\u30fc\u30b9\u3067\u3059\u3002<\/p>\n<h2>\u7d50\u5c40\u3001\u81ea\u5206\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u7d44\u307f\u307e\u3057\u305f<\/h2>\n<p>\u305d\u3046\u3044\u3046\u8a33\u3067\u3001\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u3066\u304f\u308c\u308b\u30c4\u30fc\u30eb\u3092\u63a2\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001\u30d4\u30f3\u3068\u304f\u308b\u3082\u306e\u304c\u898b\u5f53\u305f\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u6709\u511f\u306e\u30d6\u30ed\u30b0\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u3082\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u8ffd\u52a0\u306e\u30e9\u30f3\u30cb\u30f3\u30b0\u30b3\u30b9\u30c8\u3092\u304b\u3051\u3066\u307e\u3067\u3084\u308b\u306e\u306f\u3001\u3042\u307e\u308a\u6c17\u304c\u9032\u307f\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u81ea\u5206\u3067\u30c4\u30fc\u30eb\u3092\u4f5c\u308b\u4e8b\u306b\u3057\u307e\u3057\u305f\u3002\u4ee5\u4e0b\u304c\u3001\u5b9f\u969b\u306b\u4f5c\u3063\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002<\/p>\n<pre lang=\"php\" class=\"\" title=\"rss_archiver.php\" decode=\"true\">&lt;?php\nfunction get_blog_rss($max, $url) {\n\n    if (ini_get('allow_url_fopen')) {\n        $rss = simplexml_load_file($url);\n    } else {\n        $ch = curl_init($url);\n        curl_setopt($ch, CURLOPT_HEADER, false);\n        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n        $xml_raw = curl_exec($ch);\n        $rss = simplexml_load_string($xml_raw);\n    }\n\n    $cnt = 0;\n    foreach ( $rss-&gt;channel-&gt;item as $item ) {\n        $cnt += 1;\n        $pubDate = strtotime($item-&gt;pubDate);\n\n        if (strpos($item-&gt;title, 'PR:', 0) === FALSE) {\n            $filename = basename($item-&gt;link) . date('.YmdHi', $pubDate) . \".webarchive\";\n\u3000\u3000\u3000\u3000\u3000\u3000\u3000# webarchiver\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5225\u9014\u5fc5\u8981\u3067\u3059\n            system(\"\/opt\/local\/bin\/webarchiver -url {$item-&gt;link} -output {$filename}\");\n            print(\"[\". date('Y-m-d', $pubDate). \"] \" . $item-&gt;title . \" -&gt; \" . $filename . \"\\n\");\n        }\n\n        if ($max &lt;= $cnt) {\n            break;\n        }\n    }\n\n    return $list;\n}\n\n# \u6700\u8fd1\u306ePHP\u306f\u3001\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u6307\u5b9a\u304c\u5fc5\u9808\u3067\u3059\ndate_default_timezone_set(\"Asia\/Tokyo\");\n\n# \u6700\u5927\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u8a18\u4e8b\u6570\u3068\u3001RSS\u306eURL(xxxx\u306f\u3001\u30a2\u30e1\u30d6\u30ed\u306e\u30a2\u30ab\u30a6\u30f3\u30c8)\u3092\u6307\u5b9a\u3057\u307e\u3059\nget_blog_rss(10,'http:\/\/feedblog.ameba.jp\/rss\/ameblo\/xxxx\/rss20.xml');\n<\/pre>\n<p>PHP 5.5.30\u3067\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u52d5\u304b\u3059\u306b\u306f\u3001<a href=\"https:\/\/github.com\/newzealandpaul\/webarchiver\">webarchiver<\/a>\u3068\u3044\u3046\u30c4\u30fc\u30eb\u3092\u3001\uff08MacPorts\u306a\u3069\u3092\u4f7f\u3063\u3066\uff09\u5225\u9014\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3068\u52d5\u304d\u307e\u3059\u3002<\/p>\n<pre lang=\"bash\" class=\"\">#\"\/path\/to\/\"\u306f\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u914d\u7f6e\u5148\u30d1\u30b9\nphp \/path\/to\/rss_archiver.php\n<\/pre>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001\u30a2\u30e1\u30d6\u30ed\u306eRSS\u304b\u3089\u6700\u8fd1\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u53d6\u5f97\u3057\u3066\u3001\u5404\u8a18\u4e8b\u3092\u3001Safari\u306eWeb\u30a2\u30fc\u30ab\u30a4\u30d6\u5f62\u5f0f\u3067Mac\u306e\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u306b\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Web\u30a2\u30fc\u30ab\u30a4\u30d6\u306f\u3001Safari\u3067\u76f4\u63a5\u8868\u793a\u3067\u304d\u307e\u3059\u3002\u30da\u30fc\u30b8\u306e\u30c6\u30ad\u30b9\u30c8\u3084\u753b\u50cf\u304c\u305d\u306e\u307e\u307e\uff11\u3064\u306e\u30d5\u30a1\u30a4\u30eb\uff08\u6b63\u78ba\u306b\u306f\u30d0\u30f3\u30c9\u30eb\uff09\u306b\u307e\u3068\u3081\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u7ba1\u7406\u3082\u697d\u30c1\u30f3\u3067\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u306e\u76ee\u7dda\u3067\u898b\u308b\u3068\u3001\u30a2\u30e1\u30d6\u30ed\u3063\u3066\u6271\u3044\u3065\u3089\u3044\u3067\u3059\u306d\u3002RSS\u304f\u3089\u3044\u3057\u304b\u4f7f\u3048\u308bAPI\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u4eca\u306e\u3068\u3053\u308d\u3001\u30a4\u30e1\u30fc\u30b8\u901a\u308a\u4f7f\u3048\u3066\u307e\u3059<\/h2>\n<p>\u79c1\u306f\u3001\u3053\u308c\u3092\u9031\uff11\u56de\u3001\u624b\u52d5\u3067\u8d77\u52d5\u3059\u308b\u904b\u7528\u306b\u3057\u3066\u3044\u307e\u3059\u3002\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3092\u7d44\u3093\u3067\u81ea\u52d5\u8d77\u52d5\u3055\u305b\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u304c\u304d\u3061\u3093\u3068\u53d6\u308c\u3066\u3044\u308b\u4e8b\u3092\u968f\u6642\u78ba\u8a8d\u3067\u304d\u308b\u306e\u3067\u3001\u5b9f\u306f\u624b\u52d5\u306e\u307b\u3046\u304c\u304a\u624b\u8efd\u304b\u3064\u78ba\u5b9f\u3060\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30c4\u30fc\u30eb\u3092\u3001Mac\u30a2\u30d7\u30ea\u30fbWindows\u30a2\u30d7\u30ea\u5316\u3057\u3066\u5e83\u304f\u30ea\u30ea\u30fc\u30b9\u3059\u3079\u304d\u3067\u306f\uff1f\u3068\u3082\u601d\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u79c1\u81ea\u8eab\u306f\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u30a4\u30e1\u30fc\u30b8\u901a\u308a\u306e\u904b\u7528\u304c\u3067\u304d\u3066\u3044\u308b\u306e\u3067\u3001\u601d\u3044\u3068\u3069\u307e\u3063\u3066\u3044\u307e\u3059\u3002\u30ea\u30af\u30a8\u30b9\u30c8\u3042\u308c\u3070\u3001\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306a\u305c\uff1f \u79c1\u306e\u5ac1\u304c\u30a2\u30e1\u30fc\u30d0\u30d6\u30ed\u30b0\uff08\u30a2\u30e1\u30d6\u30ed\uff09\u3092\u3084\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u3064\u3044\u6700\u8fd1\u307e\u3067\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u4e00\u5207\u53d6\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u307e\u3060\u59cb\u3081\u3066\u304b\u3089\uff11\u5e74\u304f\u3089\u3044\u3057\u304b\u7d4c\u3063\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u307b\u307c\u6bce\u65e5\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059\u3002\u3067\u3059\u306e\u3067\u3001\u3053\u306e\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u305f\u3089\u304d\u3063 &hellip; <a href=\"https:\/\/spiralware.jp\/blog\/archives\/53\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u9031\uff11\u56de\u3001\u30a2\u30e1\u30d6\u30ed\u3092\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3057\u3066\u3044\u307e\u3059&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-53","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/posts\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":0,"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/posts\/53\/revisions"}],"wp:attachment":[{"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/media?parent=53"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/categories?post=53"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/spiralware.jp\/blog\/wp-json\/wp\/v2\/tags?post=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}