{"id":19145,"date":"2010-02-15T22:12:37","date_gmt":"2010-02-15T13:12:37","guid":{"rendered":"http:\/\/freenps.net\/blog\/?p=101"},"modified":"2010-02-15T22:12:37","modified_gmt":"2010-02-15T13:12:37","slug":"%e3%82%a2%e3%83%95%e3%82%a3%e3%83%aa%e3%82%a8%e3%82%a4%e3%83%88%e3%82%82ok%e3%81%ae%e7%9f%ad%e7%b8%aeurl%e4%bd%9c%e6%88%90%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/kahy.info\/?p=19145","title":{"rendered":"\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8\u3082OK\u306e\u77ed\u7e2eURL\u4f5c\u6210\u65b9\u6cd5"},"content":{"rendered":"<p><img decoding=\"async\" alt=\"\u9577\u3044URL\" height=\"40\" src=\"https:\/\/kahy.info\/wp-content\/uploads\/freenps\/nagaiurl.png\" width=\"300\" \/><\/p>\n<p>Twitter\u306e\u6295\u7a3f\u6587\u5b57\u6570\u306f140\u6587\u5b57\u307e\u3067\u3002\u3053\u3053\u306b\u9577\u3044URL\u3092\u5165\u308c\u305f\u3044\u5834\u5408\u306b\u306f\u77ed\u7e2eURL\u30b5\u30fc\u30d3\u30b9\u3092\u4f7f\u3046\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u3002<\/p>\n<p><!--more-->\u9577\u3044\u30a2\u30c9\u30ec\u30b9\u3092\u77ed\u7e2e\u3059\u308b\u7121\u6599\u30cd\u30c3\u30c8\u30b5\u30fc\u30d3\u30b9\u3044\u308d\u3044\u308d<br \/>\n\tGIGAZINE<br \/>\n\t<a href=\"http:\/\/gigazine.net\/index.php?\/news\/comments\/20070402_shortening_url\/\" target=\"_blank\">http:\/\/gigazine.net\/index.php?\/news\/comments\/20070402_shortening_url\/<\/a><\/p>\n<p>\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u3067\u3001\u300c\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8\u30bf\u30b0\u3092\u77ed\u7e2eURL\u3067Twitter\u306b\u30fb\u30fb\u30fb\u300d\u3068\u601d\u3063\u305f\u4eba\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u3053\u306e\u884c\u70ba\u306f\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8\u30bf\u30b0\u306e\u5909\u66f4\u3068\u307f\u306a\u3055\u308c\u308b\u5834\u5408\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u697d\u5929URL\u77ed\u7e2e\u306f\u898f\u7d04\u9055\u53cd<br \/>\n\t\u3061\u3087\u3044\u30b3\u30ac\u5b9f\u8df5\u30d6\u30ed\u30b0\uff5e\u4e3b\u5a66\u304c\u81ea\u5b85\u3067\u697d\u3057\u304f\u7a3c\u3050<br \/>\n\t<a href=\"http:\/\/blog.livedoor.jp\/yukky38\/archives\/482561.html\" target=\"_blank\">http:\/\/blog.livedoor.jp\/yukky38\/archives\/482561.html<br \/>\n\t<\/a><\/p>\n<p>\u77ed\u7e2e\uff35\uff32\uff2c\u306e \u30e1\u30ea\u30c3\u30c8 vs. \u30c7\u30e1\u30ea\u30c3\u30c8<br \/>\n\t\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8\u2606\u30a6\u30a9\u30fc\u30ba &#8211; \u30d6\u30ed\u30b0\u3067\u59cb\u3081\u308b\u5831\u916c\u6226\u4e89<br \/>\n\t<a href=\"http:\/\/affiliatewars.blog27.fc2.com\/blog-entry-190.html\" target=\"_blank\">http:\/\/affiliatewars.blog27.fc2.com\/blog-entry-190.html<\/a><\/p>\n<p>\u307b\u3068\u3093\u3069\u306e\u30a2\u30d5\u30a3\u30ea\u30a8\u30a4\u30c8\u30bf\u30b0\u306f\u6539\u5909\u305b\u305a\u81ea\u5206\u306e\u7ba1\u7406\u3059\u308bWEB\u30b5\u30a4\u30c8\u306b\u63b2\u8f09\u3059\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u3067\u3082\u3064\u3076\u3084\u304d\u3067\u5546\u54c1\u3092\u52e7\u3081\u305f\u3044\u6642\u306b\u3044\u3061\u3044\u3061WEB\u30da\u30fc\u30b8\uff08\u307e\u305f\u306f\u30d6\u30ed\u30b0\u306e\u8a18\u4e8b\uff09\u3092\u4f5c\u6210\u3057\u3066\u77ed\u7e2eURL\u5316\u3059\u308b\u4f5c\u696d\u306f\u7d50\u69cb\u624b\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3088\u306d\u3002\u30bf\u30a4\u30e0\u30ea\u30fc\u306b\u30c4\u30a4\u30fc\u30c8\u3067\u304d\u306a\u304f\u306a\u308b\u3057\u30fb\u30fb\u30fb\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u305d\u306e\u9762\u5012\u306a\u4f5c\u696d\u3092\u7c21\u5358\u306b\u3084\u3063\u3066\u3057\u307e\u3048\u308bPHP\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u3067\u304d\u308b\u3053\u3068\u306f\u4ee5\u4e0b\u306e4\u3064\u3002<\/p>\n<ol>\n<li>\u30bf\u30b0\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u3092\u8868\u793a<\/li>\n<li>\u77ed\u3044URL\uff08\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff09\u3092\u751f\u6210<\/li>\n<li>\u751f\u6210\u3057\u305fURL\u306b\u30bf\u30b0\u5165\u308a\u306eWEB\u30da\u30fc\u30b8\u3092\u751f\u6210<\/li>\n<li>\u77ed\u3044URL\u3092\u8868\u793a<\/li>\n<\/ol>\n<p>PHP\u30b9\u30af\u30ea\u30d7\u30c81\u3064\u3067\u5b8c\u7d50\u3057\u3001DB\u3082\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u77ed\u3044\u540d\u524d\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u3063\u3066\u3001\u305d\u306e\u4e2d\u306b\u30d5\u30a9\u30fc\u30e0\u304b\u3089\u5165\u529b\u3055\u308c\u305fHTML\u30b3\u30fc\u30c9\u3092\u5143\u306b index.html \u30d5\u30a1\u30a4\u30eb\u3092\u751f\u6210\u3057\u307e\u3059\u3002URL\u306e\u9577\u3055\u306f\u30c9\u30e1\u30a4\u30f3\u540d\u306e\u9577\u3055\u306b\u4f9d\u5b58\u3057\u307e\u3059\u3002<\/p>\n<p>\u3042\u304f\u307e\u3067\u3082\u8aac\u660e\u306e\u305f\u3081\u306b\u30b7\u30f3\u30d7\u30eb\u5316\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3084\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u7b49\u306f\u5168\u304f\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u4f7f\u3063\u305f\u308a\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u306d\u3002\uff08\u5229\u7528\u306e\u969b\u306f\u81ea\u5df1\u8cac\u4efb\u3067\u304a\u9858\u3044\u3057\u307e\u3059\uff09<\/p>\n<p>\u305d\u308c\u304b\u3089\u3001\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u306f\u81ea\u5206\u3057\u304b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u308c\u4ee5\u4e0a\u306a\u3044\u3063\u3066\u307b\u3069\u7c21\u5358\u306b\u60aa\u610f\u306e\u3042\u308b\u30b3\u30fc\u30c9\u304c\u30da\u30fc\u30b8\u306b\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3088\u3002<\/p>\n<p>\u52d5\u4f5c\u3092\u8a66\u3057\u3066\u307f\u305f\u3044\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092 sample.php \u3068\u3044\u3046\u540d\u524d\u3067\u4fdd\u5b58\u3057php\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u52d5\u4f5c\u3059\u308bWEB\u30b5\u30fc\u30d0\u30fc\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u306e\u6587\u5b57\u30b3\u30fc\u30c9\u8a2d\u5b9a\u306f&quot;UTF-8&quot;\u3068\u3057\u3066\u3042\u308b\u306e\u3067\u3001\u305d\u306e\u307e\u307e\u4f7f\u3046\u306a\u3089&quot;UTF-8&quot;\u5f62\u5f0f\u3067\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306fPHP\u304c\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4f5c\u6210\u3067\u304d\u308b\u6a29\u9650\u306b\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002Windows\u7cfb\u30b5\u30fc\u30d0\u30fc\u306e\u5834\u5408\u306f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u306e\u4fee\u6b63\u304c\u5fc5\u8981\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre><code>\n&lt;?php\n\n\/\/\u30e6\u30cb\u30fc\u30af\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d\u3092\u751f\u6210\n\/\/sample.php \u4ee5\u5916\u5165\u3063\u3066\u3044\u306a\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u524d\u63d0\nfunction uniqueDirName($currentDir){\n    $num = 1;\n    if ($handle = opendir($currentDir)) {\n        \/\/\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e2d\u8eab\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\n        while (false !== ($file = readdir($handle))) {\n            $num++;\n        }\n        closedir($handle);\n    }\n    \/\/36\u9032\u6570\u3067\u623b\u3059\n    return base_convert($num, 10, 36);\n}\n\n\/\/\u30bf\u30b0\u304cPOST\u3055\u308c\u305f\u5834\u5408\u306e\u307f\u4ee5\u4e0b\u3092\u5b9f\u884c\nif(isset($_POST['tags'])){\n\n    $currentDir = getcwd();\n    $dirName = uniqueDirName($currentDir);\n    $path = $currentDir.'\/'.$dirName;\n    mkdir($path);\n    $fileName = $path.'\/index.html';\n    $handle = fopen($fileName, 'w');\n\n    $tags = '&lt;html&gt;&lt;body&gt;';\n    $tags .= $_POST['tags'];\n    $tags .= '&lt;\/body&gt;&lt;\/html&gt;';\n\n    fwrite($handle, $tags);\n    fclose($handle);\n    \/\/***\u306f\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8a2d\u7f6e\u3057\u305fURL\n    echo 'http:\/\/****\/'.$dirName;\n    exit();\n}\n\n?&gt;\n\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;ja&quot;&gt;\n&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot;&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;b&gt;\u30bf\u30b0\u77ed\u7e2e&lt;\/b&gt;\n&lt;form action=&quot;sample.php&quot; method=&quot;post&quot;&gt;\n&lt;textarea name=&quot;tags&quot; rows=&quot;3&quot; cols=&quot;60&quot; onfocus=&quot;this.select()&quot;&gt;\u30bf\u30b0\u3092\u3053\u3053\u306b\u30da\u30fc\u30b9\u30c8&lt;\/textarea&gt;&lt;br \/&gt;\n&lt;input type=&quot;hidden&quot; name=&quot;urltype&quot; value=&quot;tags&quot;&gt;\n&lt;input type=&quot;submit&quot; value=&quot;\u30bf\u30b0\u77ed\u7e2e&quot; \/&gt;\n&lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>\n\t\u300c\u77ed\u7e2eURL\u300d\u3068\u3044\u3046\u3088\u308a\u306f\u300c\u77ed\u3044URL\u306eWEB\u30da\u30fc\u30b8\u3092\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u300d\u3067\u3059\u306d\u30fb\u30fb\u30fb\u3002<\/p>\n<div id=\"wppda_alert\">\u3053\u306e\u8a18\u4e8b\u306f\u516c\u958b\u5f8c1\u5e74\u4ee5\u4e0a\u7d4c\u904e\u3057\u3066\u3044\u307e\u3059\u3002<br\/>\u73fe\u5728\u306f\u72b6\u6cc1\u304c\u7570\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/div>","protected":false},"excerpt":{"rendered":"<p>Twitter\u306e\u6295\u7a3f\u6587\u5b57\u6570\u306f140\u6587\u5b57\u307e\u3067\u3002\u3053\u3053\u306b\u9577\u3044URL\u3092\u5165\u308c\u305f\u3044\u5834\u5408\u306b\u306f\u77ed\u7e2eURL\u30b5\u30fc\u30d3\u30b9\u3092\u4f7f\u3046\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5617,3],"tags":[5624,5638],"class_list":["post-19145","post","type-post","status-publish","format-standard","hentry","category-freenps","category-3","tag-twitter","tag-url"],"_links":{"self":[{"href":"https:\/\/kahy.info\/index.php?rest_route=\/wp\/v2\/posts\/19145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kahy.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kahy.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kahy.info\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kahy.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19145"}],"version-history":[{"count":0,"href":"https:\/\/kahy.info\/index.php?rest_route=\/wp\/v2\/posts\/19145\/revisions"}],"wp:attachment":[{"href":"https:\/\/kahy.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kahy.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kahy.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}