{"id":6,"date":"2026-03-04T13:28:51","date_gmt":"2026-03-04T04:28:51","guid":{"rendered":"http:\/\/dreampress.xvs.jp\/kanri\/?page_id=6"},"modified":"2026-03-04T13:28:51","modified_gmt":"2026-03-04T04:28:51","slug":"%e3%83%9d%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%97%e3%82%83%e3%81%b9%e3%82%8bai","status":"publish","type":"page","link":"https:\/\/dreampress.xvs.jp\/kanri\/%e3%83%9d%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%97%e3%82%83%e3%81%b9%e3%82%8bai\/","title":{"rendered":"\u30dd\u30b9\u30bf\u30fc\u3057\u3083\u3079\u308bAI"},"content":{"rendered":"    <div id=\"ai-app-poster\" style=\"max-width: 500px; margin: 20px auto; padding: 20px; border: 2px solid #ffcc00; border-radius: 15px; background: #fff; text-align: center; font-family: sans-serif;\">\n        <h2 style=\"color: #ffcc00; margin-top:0;\">?? \u30dd\u30b9\u30bf\u30fc\u9023\u52d5\u30ac\u30a4\u30c9<\/h2>\n        <video id=\"v-poster\" autoplay playsinline style=\"width: 100%; border-radius: 10px; background: #000;\"><\/video>\n        <canvas id=\"c-poster\" style=\"display:none;\"><\/canvas>\n        <button id=\"b-poster\" style=\"background: #ffcc00; color: #fff; padding: 15px; border: none; border-radius: 50px; cursor: pointer; font-size: 16px; font-weight: bold; width: 100%; margin-top:10px;\">\u30dd\u30b9\u30bf\u30fc\u3092\u8aad\u307f\u53d6\u308b<\/button>\n        <div id=\"r-poster\" style=\"margin-top: 20px; text-align: left; padding: 15px; background: #f9f9f9; border-radius: 10px; border-left: 5px solid #ffcc00; min-height: 80px; font-size: 14px;\">\u6e96\u5099\u4e2d...<\/div>\n    <\/div>\n\n    <script>\n    (function() {\n        const video = document.getElementById('v-poster');\n        const canvas = document.getElementById('c-poster');\n        const btn = document.getElementById('b-poster');\n        const res = document.getElementById('r-poster');\n        \n        navigator.mediaDevices.getUserMedia({ video: true }).then(s => video.srcObject = s);\n\n        btn.onclick = async () => {\n            btn.disabled = true;\n            res.innerHTML = \"? AI\u304c\u89e3\u6790\u3057\u3066\u3044\u307e\u3059...\";\n            canvas.width = video.videoWidth;\n            canvas.height = video.videoHeight;\n            canvas.getContext('2d').drawImage(video, 0, 0);\n            const base64 = canvas.toDataURL('image\/jpeg').split(',')[1];\n\n            try {\n                const response = await fetch('https:\/\/generativelanguage.googleapis.com\/v1beta\/models\/gemini-1.5-flash:generateContent?key=AIzaSyB3pBWrW6p2pYkyjJUfFAzE-Ng2CQ3G7_g', {\n                    method: 'POST',\n                    headers: { 'Content-Type': 'application\/json' },\n                    body: JSON.stringify({\n                        contents: [{\n                            parts: [\n                                { text: \"\u753b\u50cf\u5185\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3092\u7279\u5b9a\u3057\u3001\u30dd\u30b9\u30bf\u30fc\u306e\u6587\u5b57\u60c5\u5831\u3092\u8aad\u307f\u53d6\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u306e\u30ad\u30e3\u30e9\u306b\u306a\u308a\u304d\u3063\u3066\u3001\u30dd\u30b9\u30bf\u30fc\u306e\u5185\u5bb9\u3092\u8a71\u3057\u8a00\u8449\u3067150\u5b57\u7a0b\u5ea6\u3067\u89e3\u8aac\u3057\u3066\u304f\u3060\u3055\u3044\u3002\" },\n                                { inline_data: { mime_type: \"image\/jpeg\", data: base64 } }\n                            ]\n                        }]\n                    })\n                });\n                const d = await response.json();\n                res.innerHTML = d.candidates[0].content.parts[0].text.replace(\/\\n\/g, '<br>');\n            } catch (e) {\n                res.innerHTML = \"\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\";\n            } finally {\n                btn.disabled = false;\n            }\n        };\n    })();\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/pages\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":1,"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/pages\/6\/revisions"}],"predecessor-version":[{"id":7,"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/pages\/6\/revisions\/7"}],"wp:attachment":[{"href":"https:\/\/dreampress.xvs.jp\/kanri\/wp-json\/wp\/v2\/media?parent=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}