{"id":1086,"date":"2017-08-18T13:29:06","date_gmt":"2017-08-18T04:29:06","guid":{"rendered":"https:\/\/www.dogrow.net\/python\/?p=1086"},"modified":"2019-10-19T12:06:55","modified_gmt":"2019-10-19T03:06:55","slug":"blog88","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/python\/blog88\/","title":{"rendered":"(88) \u30e9\u30a4\u30d6\u30ab\u30e1\u30e9\u753b\u50cf\u3092\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306b\u8cbc\u308b\u3002"},"content":{"rendered":"<h1 class=\"my_h1\">\u25a0\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u30fb\u5b9f\u5bb6\u306e\u7a93\u969b\u306b\u30e9\u30a4\u30d6\u30ab\u30e1\u30e9\u3092\u8a2d\u7f6e\u3057\u3001\u7a93\u304b\u3089\u898b\u3048\u308b\u666f\u8272\u3092\u6771\u4eac\u3067\u3082\u773a\u3081\u305f\u3044\u3002<br \/>\n\u30fb\u6620\u50cf\u3067\u306f\u306a\u304f\u3001\uff11\u5206\u306b\uff11\u56de\u7a0b\u5ea6\u66f4\u65b0\u3055\u308c\u308b\u9759\u6b62\u753b\u3067\u3088\u3044\u3002<br \/>\n\u30fb\u30ab\u30e1\u30e9\u306f\u306a\u308b\u3079\u304f\u5b89\u4fa1\u306a\u3082\u306e\u304c\u3088\u3044\u3002<\/p>\n<h1 class=\"my_h1\">\u25a0\u5fc5\u8981\u306a\u3082\u306e<\/h1>\n<p>\u30fb\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u8a2d\u7f6e\u30b5\u30fc\u30d0\u30fc\uff08FTP,Python,PHP\u304c\u4f7f\u3048\u308b\u3053\u3068\uff09<br \/>\n\u30fbWEB\u30ab\u30e1\u30e9\uff08Wifi\u63a5\u7d9a\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\uff09<\/p>\n<h1 class=\"my_h1\">\u25a0\u624b\u9806<\/h1>\n<h3 class=\"my_h3\">\u624b\u9806\uff11\uff1aWEB\u30ab\u30e1\u30e9\u3092\u8cfc\u5165\u3059\u308b\u3002<\/h3>\n<p>\u30fb\u4eca\u56de\u306fI-O DATA\u793e\u88fd\u306e TS-WRLCE \u3092\u4f7f\u7528\u3059\u308b\u3002\uff08\u305d\u306e\u5f8c\u3001\u8d64\u5916\u7dda\u30ab\u30e1\u30e9\u4ed8\u304d\u306eTS-WLC2\u3067\u3082\u540c\u3058\u624b\u9806\u3067\u3067\u304d\u305f\u3002\uff09<\/p>\n<div style=\"display:inline-table\">\n<iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"https:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?ref=qf_sp_asin_til&#038;t=viseu-22&#038;m=amazon&#038;o=9&#038;p=8&#038;l=as1&#038;IS2=1&#038;detail=1&#038;asins=B00ZB8O2CI&#038;linkId=fcbcf6b01dc0562be78e8b43c38e4fcf&#038;bc1=000000&#038;lt1=_blank&#038;fc1=333333&#038;lc1=0066c0&#038;bg1=ffffff&#038;f=ifr\"><br \/>\n    <\/iframe><\/div>\n<div style=\"display:inline-table\">\n<iframe style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"https:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?ref=qf_sp_asin_til&#038;t=viseu-22&#038;m=amazon&#038;o=9&#038;p=8&#038;l=as1&#038;IS2=1&#038;detail=1&#038;asins=B00GGXBAGI&#038;linkId=832aee27bfd4f42a3c98fcb8e875ffd0&#038;bc1=000000&#038;lt1=_blank&#038;fc1=333333&#038;lc1=0066c0&#038;bg1=ffffff&#038;f=ifr\"><br \/>\n    <\/iframe><\/div>\n<h3 class=\"my_h3\" style=\"margin-top:1.5rem\">\u624b\u9806\uff12\uff1aWEB\u30ab\u30e1\u30e9\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u3002<\/h3>\n<p>\u30fb\u753b\u50cf\u3092\u8ee2\u9001\u3059\u308bFTP\u30b5\u30fc\u30d0\u30fc\u306e\u60c5\u5831\u3092\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/python\/wp-content\/uploads\/2017\/08\/Image2-2.png\" alt=\"\" class=\"my_img\" \/><\/p>\n<p>\u30fb\u52d5\u4f5c\u691c\u77e5\u306e\u691c\u51fa\u7bc4\u56f2\u3092\u753b\u9762\u5168\u4f53\u306b\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/python\/wp-content\/uploads\/2017\/08\/Image6.png\" alt=\"\" class=\"my_img\" \/><\/p>\n<p>\u30fb\u52d5\u4f5c\u691c\u77e5\u306e\u691c\u51fa\u9593\u9694\u3092\uff16\uff10\u79d2\u306b\u8a2d\u5b9a\u3057\u3001\u52d5\u4f5c\u691c\u77e5\u6a5f\u80fd\u3092\u6709\u52b9\u306b\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/python\/wp-content\/uploads\/2017\/08\/Image4.png\" alt=\"\" class=\"my_img\" \/><\/p>\n<h3 class=\"my_h3\" style=\"margin-top:1.5rem\">\u624b\u9806\uff13\uff1a\u6700\u65b0\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u53d6\u5f97\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\uff08Python\uff09<\/h3>\n<p>\u3053\u306e\u30e9\u30a4\u30d6\u30ab\u30e1\u30e9\u306f\u3001\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u300csnapshot_yyyymmddhhmm\u300d\u306a\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8907\u6570\u4f5c\u6210\u3059\u308b\u3002\u3055\u3089\u306b\u3001\u500b\u3005\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u300cmotion-yyyy-mm-dd-hh-mm-ss.jpg\u300d\u306a\u308bJPEG\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u8907\u6570\u4f5c\u6210\u3059\u308b\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dogrow.net\/python\/wp-content\/uploads\/2017\/08\/Image8.png\" alt=\"\" width=\"332\" height=\"408\" class=\"my_img\" \/><\/p>\n<p>\u3057\u305f\u304c\u3063\u3066\u3001\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u4e0a\u306b\u6700\u65b0\u306e\uff11\u679a\u3092\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6700\u65b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u6700\u65b0\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\uff11\u500b\u3060\u3051\u53d6\u5f97\u3057\u3001\u8868\u793a\u3059\u308c\u3070\u3088\u3044\u3002\u3053\u3053\u3067\u306fPython\u3067\u3053\u306e\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u3002<\/p>\n<h4>get_img.py<\/h4>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport sys\r\nimport os\r\n\r\n#---------------------------------\r\n# argv&#x5B;1] : directory path\r\nif __name__ == '__main__':\r\n    ary_argv = sys.argv\r\n    img_path = ary_argv&#x5B;1] + &quot;\/&quot;\r\n\r\n    # \u6307\u5b9a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u6700\u65b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u53d6\u5f97\r\n    ary_entry = os.listdir(img_path)\r\n    ary_entry = &#x5B;x for x in ary_entry if os.path.isdir(img_path + x) ]\r\n    ary_entry = sorted(ary_entry, reverse=True)\r\n    target_dir = img_path + ary_entry&#x5B;0] + &quot;\/&quot;\r\n\r\n    # \u6700\u65b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306e\u6700\u65b0\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\r\n    ary_jpeg = os.listdir(target_dir)\r\n    ary_jpeg = &#x5B;x for x in ary_jpeg if os.path.isfile(target_dir + x) ]\r\n    ary_jpeg = sorted(ary_jpeg, reverse=True)\r\n    target_jpeg = ary_jpeg&#x5B;0]\r\n\r\n    # \u5b9f\u884c\u8005\u3078\u7b54\u3048\u3092\u63d0\u4f9b\r\n    print(target_dir + target_jpeg)\r\n<\/pre>\n<h3 class=\"my_h3\" style=\"margin-top:1.5rem\">\u624b\u9806\uff14\uff1a\u30e9\u30a4\u30d6\u753b\u50cf\u3092\u95b2\u89a7\u3059\u308b\u305f\u3081\u306e\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3092\u4f5c\u6210\uff08HTML+PHP\uff09<\/h3>\n<h4>livecam.php<\/h4>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;HTML&gt;\r\n&lt;HEAD&gt;\r\n&lt;META http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=utf-8&quot; \/&gt;\r\n&lt;TITLE&gt;\u30b5\u30f3\u30d7\u30eb&lt;\/TITLE&gt;\r\n&lt;\/HEAD&gt;\r\n&lt;\/BODY&gt;\r\n&lt;?php\r\n  exec(&quot;python3 .\/get_img.py '{FTP\u753b\u50cf\u8ee2\u9001\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea}'&quot;, $resp, $code);\r\n  echo &quot;&lt;img src='{$resp&#x5B;0]}'&gt;&quot;;\r\n?&gt;\r\n&lt;\/BODY&gt;\r\n&lt;\/HTML&gt;\r\n<\/pre>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>\u25a0\u3084\u308a\u305f\u3044\u3053\u3068 \u30fb\u5b9f\u5bb6\u306e\u7a93\u969b\u306b\u30e9\u30a4\u30d6\u30ab\u30e1\u30e9\u3092\u8a2d\u7f6e\u3057\u3001\u7a93\u304b\u3089\u898b\u3048\u308b\u666f\u8272\u3092\u6771\u4eac\u3067\u3082\u773a\u3081\u305f\u3044\u3002 \u30fb\u6620\u50cf\u3067\u306f\u306a\u304f\u3001\uff11\u5206\u306b\uff11\u56de\u7a0b\u5ea6\u66f4\u65b0\u3055\u308c\u308b\u9759\u6b62\u753b\u3067\u3088\u3044\u3002 \u30fb\u30ab\u30e1\u30e9\u306f\u306a\u308b\u3079\u304f\u5b89\u4fa1\u306a\u3082\u306e\u304c\u3088\u3044\u3002 \u25a0\u5fc5\u8981\u306a\u3082\u306e \u30fb\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u8a2d\u7f6e\u30b5\u30fc\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/python\/blog88\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26,8],"tags":[],"class_list":["post-1086","post","type-post","status-publish","format-standard","hentry","category-web","category-8"],"views":5359,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/1086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/comments?post=1086"}],"version-history":[{"count":21,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/1086\/revisions"}],"predecessor-version":[{"id":2729,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/posts\/1086\/revisions\/2729"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/media?parent=1086"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/categories?post=1086"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/python\/wp-json\/wp\/v2\/tags?post=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}