{"id":2363,"date":"2016-11-20T02:32:39","date_gmt":"2016-11-19T17:32:39","guid":{"rendered":"http:\/\/1bed.allright.life\/?p=2363"},"modified":"2020-04-18T21:01:59","modified_gmt":"2020-04-18T12:01:59","slug":"post-2363","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=2363","title":{"rendered":"Google Custom Search API \u3068 Microsoft Cognitive Services \u3092\u4f7f\u3063\u3066 misono \u306e\u8868\u60c5\u306e\u5272\u5408\u3092\u51fa\u3057\u3066 NetOffice \u3067 Excel \u306b\u30b0\u30e9\u30d5\u5316\u3057\u305f"},"content":{"rendered":"<p>Microsoft Cognitive Services \u3092\u4f7f\u3063\u3066\u4f55\u304b\u3084\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u3001\u6563\u6b69\u3057\u306a\u304c\u3089\u8003\u3048\u305f\u7d50\u679c\u3001Google Custom API \u3092\u4f7f\u3063\u3066\u753b\u50cf\u3092\u691c\u7d22\u3057\u3066\u3001\u305d\u306e\u753b\u50cf\u306e\u8868\u60c5\u3092 Microsoft Cognitive Services \u3067\u53d6\u5f97\u3057\u3066\u5272\u5408\u3092\u78ba\u8a8d\u3057\u305f\u6642\u306e\u5099\u5fd8\u9332\u3067\u3059\u3002<\/p>\n<h2>\u753b\u50cf\u3092\u96c6\u3081\u308b<\/h2>\n<p>\u307e\u305a\u306f Google Custom Search API \u306e\u6e96\u5099\u3092\u884c\u3044\u307e\u3059\u3002 \u79c1\u306f\u4ee5\u524d Hubot \u3067\u904a\u3093\u3067\u3044\u308b\u6642\u306b\u8a2d\u5b9a\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u5168\u7136\u899a\u3048\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u5099\u5fd8\u9332\u3068\u3057\u3066\u8a73\u3057\u3081\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<h3>1. \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308a\u307e\u3059(Google Custom Search API \u306e\u6e96\u5099)<\/h3>\n<ul>\n<li>\n<p>1-1. <a href=\"https:\/\/console.developers.google.com\/iam-admin\/projects?hl=JA\">\u300cIAM \u3068\u7ba1\u7406\u300d\u306e\u300c\u5168\u3066\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300d<\/a> \u304b\u3089\u3001[\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/1-m.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/1-m-300x146.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>1-2. \u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u3092\u5165\u529b\u3057\u307e\u3059(\u5c11\u3057\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059)<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/2-m.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/2-m-300x145.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>1-3. \u753b\u9762\u304c\u5207\u308a\u66ff\u308f\u3063\u305f\u5f8c\u3001[Custom Search API] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/3-m.png\" data-rel=\"lightbox-image-2\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/3-m-300x202.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>1-4. [\u6709\u52b9\u306b\u3059\u308b] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/4-m.png\" data-rel=\"lightbox-image-3\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/4-m-300x104.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>1-5. [\u8a8d\u8a3c\u60c5\u5831\u306b\u9032\u3080] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/5-m.png\" data-rel=\"lightbox-image-4\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/5-m-300x58.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>1-6. \u5fc5\u8981\u306a\u8a8d\u8a3c\u60c5\u5831\u306e\u7a2e\u985e\u3092\u300cCustom Search API\u300d\u306b\u9078\u629e\u3057\u3066\u3001[\u5fc5\u8981\u306a\u8a8d\u8a3c\u60c5\u5831] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/6-m.png\" data-rel=\"lightbox-image-5\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/6-m-300x144.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>1-7. API \u30ad\u30fc\u3092\u30b3\u30d4\u30fc\u3057\u3066\u30e1\u30e2\u5e33\u3068\u304b\u306b\u8cbc\u308a\u4ed8\u3051\u3066\u304a\u3044\u3066\u3001[\u5b8c\u4e86] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/7-m.png\" data-rel=\"lightbox-image-6\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/7-m-300x183.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<\/ul>\n<h3>2. Custom Search Engine \u3092\u4f5c\u6210\u3057\u307e\u3059(Google Custom Search API \u306e\u6e96\u5099)<\/h3>\n<ul>\n<li>\n<p>2-1. <a href=\"https:\/\/cse.google.com\/cse\/all\">CSE(Custom Search Engine)https:\/\/cse.google.com\/cse\/all<\/a> \u306e\u753b\u9762\u304b\u3089 [Add] \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/8-m.png\" data-rel=\"lightbox-image-7\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/8-m-300x120.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>2-2. \u691c\u7d22\u3059\u308b\u30b5\u30a4\u30c8\u306b\u300cwww.google.co.jp\/*\u300d\u3001\u8a00\u8a9e\u3092\u300c\u65e5\u672c\u8a9e\u300d\u3068\u9078\u629e\u3057\u3066 [\u4f5c\u6210] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/9-m.png\" data-rel=\"lightbox-image-8\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/9-m-300x288.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>2-3. [\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb] \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/10-m.png\" data-rel=\"lightbox-image-9\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/10-m-300x238.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>2-4. [\u691c\u7d22\u30a8\u30f3\u30b8\u30f3ID] \u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u8868\u793a\u3055\u308c\u305f\u691c\u7d22\u30a8\u30f3\u30b8\u30f3 ID \u3092\u30e1\u30e2\u5e33\u3068\u304b\u306b\u8cbc\u308a\u4ed8\u3051\u3066\u304a\u304d\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/12-m.png\" data-rel=\"lightbox-image-10\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/12-m-300x246.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>2-5. \u300c\u753b\u50cf\u691c\u7d22\u300d\u3092\u30aa\u30f3\u306b\u3001\u691c\u7d22\u3059\u308b\u30b5\u30a4\u30c8\u3092\u300c\u8ffd\u52a0\u3057\u305f\u30b5\u30a4\u30c8\u3092\u91cd\u8996\u3057\u3066\u3001\u30a6\u30a7\u30d6\u5168\u4f53\u3092\u691c\u7d22\u3059\u308b\u300d\u306b\u9078\u629e\u3057\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/13-m.png\" data-rel=\"lightbox-image-11\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/13-m-300x164.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<\/ul>\n<h3>3. Google Custom API \u3092 PowerShell \u3067\u53e9\u3044\u3066\u307f\u308b<\/h3>\n<p>\u65e9\u901f API \u3092\u53e9\u3044\u3066\u753b\u50cf\u306e URL \u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-powershell\">$uri = &#039;https:\/\/www.googleapis.com\/customsearch\/v1?searchType=image&amp;key={0}&amp;cx={1}&amp;q={2}&amp;start={3}&#039;\n\n$result = Invoke-RestMethod -Uri (`\n    $uri -f &#039;\u624b\u9806 1-7 \u3067\u53d6\u5f97\u3057\u305f API \u30ad\u30fc&#039;, `\n            &#039;\u624b\u9806 2-4 \u3067\u53d6\u5f97\u3057\u305f\u691c\u7d22\u30a8\u30f3\u30b8\u30f3ID&#039;, `\n            &#039;misono&#039;, 1)\n$links = $result.items.link<\/code><\/pre>\n<p>\u4e00\u5ea6\u306b 10 \u4ef6\u306e URL \u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u4e0a\u8a18\u306e\u4f8b\u3067\u306f\u3001\u6050\u3089\u304f <code>$links<\/code> \u5185\u306b misono \u306e\u5199\u771f\u306e URL \u304c 10 \u500b\u30b2\u30c3\u30c8\u3067\u304d\u3066\u3044\u308b\u306f\u305a&#8230; (\uff7a\uff9e\uff78\uff98<\/p>\n<h2>\u753b\u50cf\u304b\u3089\u8868\u60c5\u30c7\u30fc\u30bf\u3092\u53ce\u96c6\u3059\u308b<\/h2>\n<p>Microsoft Cognitive Services \u306e Emotion API \u3092\u4f7f\u3063\u3066\u8868\u60c5\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>4. Microsoft Cognitive Services \u3092\u4f7f\u3046\u6e96\u5099<\/h3>\n<p>\u4e0b\u8a18\u8a18\u4e8b\u304c\u5224\u308a\u3084\u3059\u3044\u3067\u3059\u3002\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\uff01<\/p>\n<ul>\n<li>\n<p><a href=\"http:\/\/qiita.com\/annie\/items\/ba6392b7d1a7647adc4b\">\u4eba\u5de5\u77e5\u80fd\u30d1\u30fc\u30c4 Microsoft Cognitive Services \u3092\u4f7f\u3063\u305f\u8868\u60c5\u5206\u6790\u30a2\u30d7\u30ea\u3092\u4f5c\u308d\u3046\uff01[\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3\u6e96\u5099\u7de8]<\/a><\/p>\n<\/li>\n<li>\n<p>\u6700\u5f8c\u306b API \u30ad\u30fc\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002Show \u3092\u62bc\u3059\u3068 Key \u304c\u8868\u793a\u3055\u308c\u307e\u3059<br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/14-m.png\" data-rel=\"lightbox-image-12\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/14-m-300x197.png\" alt=\"\" \/><\/a><\/p>\n<\/li>\n<\/ul>\n<h3>5. Microsoft Cognitive Services \u306e Emotion API \u3067\u60c5\u5831\u3092\u53d6\u5f97<\/h3>\n<pre><code class=\"language-powershell\">$EMOTION_API_KEY = &#039;\u624b\u9806 4 \u3067\u53d6\u5f97\u3057\u305f Emotion API \u30ad\u30fc&#039;\n$uri = &#039;https:\/\/api.projectoxford.ai\/emotion\/v1.0\/recognize&#039;\n\n# \u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u308a\u307e\u3059\n&#039;anger&#039;, &#039;contempt&#039;, &#039;disgust&#039;, &#039;fear&#039;, &#039;happiness&#039;, &#039;neutral&#039;, &#039;sadness&#039;, &#039;surprise&#039; | %{$scores.Set_Item($_, 0)}\n\n# \u5148\u306b\u53d6\u5f97\u3057\u305f\u30ea\u30f3\u30af\u5206\u7e70\u308a\u8fd4\u3059\nforeach($link in $links)\n{\n    $result = Invoke-RestMethod `\n        -Uri $uri `\n        -Method Post `\n        -ContentType &#039;application\/json&#039; `\n        -Headers @{&#039;Ocp-Apim-Subscription-Key&#039; = $EMOTION_API_KEY } `\n        -body (ConvertTo-Json(@{&#039;url&#039; = $link}))\n\n    # \u5199\u771f\u304c1\u4eba\u306e\u6642\u306b\u5024\u3092\u5408\u8a08\u3057\u307e\u3059\n    if($result.scores.Count -eq 1) {\n        $scores.Clone() | %{$_.Keys} | %{$scores.$_ += $result.scores.$_}\n    }\n\n}<\/code><\/pre>\n<p>\u5b9f\u884c\u3057\u305f\u7d50\u679c\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f<\/p>\n<pre><code class=\"language-powershell\">$scores\n\nName                           Value\n----                           -----\nneutral                        3.698848848245151\nsurprise                       0.643928084988507\nfear                           0.06122704455735687\nsadness                        0.189069839999830918\ndisgust                        0.001162667252236\nanger                          0.0045491115141025\ncontempt                       0.022837591950848\nhappiness                      4.37837686581<\/code><\/pre>\n<h2>Excel \u3067\u30b0\u30e9\u30d5\u5316\u3059\u308b<\/h2>\n<p>\u6570\u5024\u3060\u3051\u307f\u3066\u3082\u3001\u81ea\u7136\u306a\u8868\u60c5\u304b\u559c\u3093\u3067\u3044\u308b\u5199\u771f\u304c\u591a\u3044\u306e\u304c\u5224\u308a\u307e\u3059\u304c\u3001\u6298\u89d2\u3067\u3059\u306e\u3067\u624b\u5143\u306e Excel \u3067\u30b0\u30e9\u30d5\u5316\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u904e\u53bb\u3001COM \u3092\u4f7f\u3063\u305f\u308a(<a href=\"http:\/\/qiita.com\/miyamiya\/items\/161372111b68bad0744a\">PowerShell \u3067 Excel \u3092\u3069\u3046\u306e\u3053\u3046\u306e\u3059\u308b\u3053\u3068\u306b\u8208\u5473\u3092\u6301\u3063\u3066\u304f\u308c\u308b\u3068\u5b09\u3057\u3044<\/a>)\u3001ClosedXML \u3092\u4f7f\u3063\u305f\u308a\u3057\u3066(<a href=\"http:\/\/qiita.com\/miyamiya\/items\/fd93d633afa0314f231a\">PowerShell \u3067 ClosedXML \u3092\u4f7f\u3063\u3066 Excel \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b<\/a>) Excel \u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f NetOffice \u3092\u4f7f\u3063\u3066\u30b0\u30e9\u30d5\u4f5c\u6210\u3092\u8a66\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>6. NetOffice \u306e\u6e96\u5099<\/h3>\n<ul>\n<li>\n<p>NetOffice \u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3068\u5c55\u958b<br \/>\n<a href=\"http:\/\/netoffice.codeplex.com\/\">CodePlex \u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059<\/a><br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/15-m.png\" data-rel=\"lightbox-image-13\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/15-m-300x181.png\" alt=\"\" \/><\/a><br \/>\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u5f8c\u3001\u9069\u5f53\u306a\u5834\u6240\u306b\u5c55\u958b\u3057\u307e\u3059\u3002\u79c1\u306f\u4eca\u56de C \u30c9\u30e9\u30a4\u30d6\u76f4\u4e0b\u306b\u5c55\u958b\u3057\u307e\u3057\u305f\u3002<\/p>\n<\/li>\n<li>\n<p>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u89b3\u70b9\u304b\u3089\u30d6\u30ed\u30c3\u30af\u304c\u65bd\u3055\u308c\u3066\u3044\u307e\u3059 \u306e\u3067 \u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f zip \u30d5\u30a1\u30a4\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u958b\u304d\u3001\u30d6\u30ed\u30c3\u30af\u306e\u89e3\u9664\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066 OK \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u307e\u3059<\/p>\n<\/li>\n<li>\n<p>\u3057\u304b\u3057\u3001\u4eca\u56de\u306e\u65b9\u6cd5\u3060\u3068 .NET 2.0 \uff5e \u304b\u3089\u306e\u30d0\u30a4\u30ca\u30ea\u3084\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u307e\u3067\u4e38\u3054\u3068\u5165\u3063\u3066\u3044\u3066\u3001<strong>\u5727\u7e2e\u3055\u308c\u305f\u72b6\u614b\u3067 150MB \u7a0b\u5ea6\u3001\u5c55\u958b\u3059\u308b\u3068 950MB \u7a0b\u5ea6<\/strong>\u306b\u306a\u308a\u307e\u3057\u305f\u306e\u3067\u3001NuGet \u304c\u5165\u3063\u3066\u3044\u308b\u74b0\u5883\u306a\u3089 NuGet \u304b\u3089 NetOffice.Excel \u3092\u6307\u5b9a\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u307b\u3046\u304c\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093(\u672a\u78ba\u8a8d)\u3002<br \/>\n\u25a0 \u53c2\u8003<\/p>\n<ul>\n<li><a href=\"https:\/\/www.nuget.org\/packages\/NetOffice.Excel\/\">NuGet Gallery | NetOffice.Excel 1.7.3<\/a><\/li>\n<li><a href=\"https:\/\/www.ka-net.org\/blog\/?p=7207\">PowerShell\u304b\u3089NetOffice\u3092\u4f7f\u3063\u3066Excel\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>7. \u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092 Excel \u306b\u4fdd\u5b58\u3057\u3066\u30b0\u30e9\u30d5\u3067\u8868\u793a\u3059\u308b<\/h3>\n<p>\u672c\u624b\u9806\u3067\u306f\u3001<code>$xls.Visible = $true<\/code> \u3068\u3057\u3066 Excel \u3092\u8868\u793a\u3055\u305b\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u6d41\u3059\u3068\u4e00\u3064\u4e00\u3064 Excel \u304c\u52d5\u4f5c\u3059\u308b\u3053\u3068\u78ba\u8a8d\u3067\u304d\u3001\u306a\u304b\u306a\u304b\u697d\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u662f\u975e\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u30b3\u30d4\u30da\u3067\u3044\u3044\u306e\u3067\u4e00\u884c\u3065\u3064 PowerShell \u3067\u5b9f\u884c\u3057\u3066\u9802\u3051\u305f\u3089\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-powershell\">[void][Reflection.Assembly]::LoadFile(&quot;C:\\NetOffice 1.7.3\\Toolbox Binaries\\NetOffice.dll&quot;)\n[void][Reflection.Assembly]::LoadFile(&quot;C:\\NetOffice 1.7.3\\Toolbox Binaries\\OfficeApi.dll&quot;)\n[void][Reflection.Assembly]::LoadFile(&quot;C:\\NetOffice 1.7.3\\Toolbox Binaries\\ExcelApi.dll&quot;)\n[void][Reflection.Assembly]::LoadFile(&quot;C:\\NetOffice 1.7.3\\Toolbox Binaries\\VBIDEApi.dll&quot;)\n\n$xls = New-Object NetOffice.ExcelApi.Application\n$xls.Visible = $true\n\n$book = $xls.Workbooks.Add()\n$sheet1 = $book.Worksheets[1] # View \u30b7\u30fc\u30c8\u7528\n$sheet2 = $book.Sheets.Add()  # Data \u30b7\u30fc\u30c8\u7528\n\n$y = 1\n$sheet2.Cells[$y++, 2].Value = &#039;\u8868\u60c5\u306e\u5272\u5408&#039;\n@{\n  anger    = &#039;o(\uff40\u3078\u00b4)o \uff8c\uff9f\uff9d\uff8c\uff9f\uff9d!!&#039;\n  contempt = &quot;\u2510(&#039;\uff5e`\uff1b)\u250c \uff94\uff9a\uff94\uff9a&quot;\n  disgust  = &#039;(\u00b4\uff65\u0434\uff65`) \uff94\uff80\uff9e&#039;\n  fear     = &quot;((\uff1b\uff9f\u0414\uff9f)\uff76\uff9e\uff78\uff76\uff9e\uff78\uff8c\uff9e\uff99\uff8c\uff9e\uff99&quot;\n  happiness= &#039;\u30fe(=^\u25bd^=)\u30ce&#039;\n  neutral  = &#039;( \uff65 _ \uff65 )&#039;\n  sadness  = &#039;(\u00b4\u30fb\uff3f\u30fb`)&#039;\n  surprise = &#039;w(\uffe3\u25bd\uffe3;)w\uff9c\uff75\uff6f!!&#039;\n}.GetEnumerator() | %{$sheet2.Cells[$y, 1].Value = $_.Value; $sheet2.Cells[$y++, 2].Value = $scores.($_.Name);}\n\n# \n$chart = ($sheet1.ChartObjects()).Add(10, 10, 500, 300)\n$chart.Chart.ChartType = [NetOffice.ExcelApi.Enums.XlChartType]::xlPie\n$chart.Chart.SetSourceData($sheet2.Range(&quot;A1:B9&quot;))\n\n# \u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306b\u4fdd\u5b58\n$book.SaveAs(&quot;${HOME}\\Desktop\\hoge.xlsx&quot;)\n\n#\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7834\u68c4\n$xls.Quit()<\/code><\/pre>\n<p>\u4e0a\u8a18\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u7d50\u679c\u306f\u6b21\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/20-m.png\" data-rel=\"lightbox-image-14\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/20-m-141x300.png\" alt=\"\" \/><\/a><br \/>\n<a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/21.png\" data-rel=\"lightbox-image-15\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/21-282x300.png\" alt=\"\" \/><\/a><\/p>\n<p>\u9854\u6587\u5b57\u3060\u3068\u5224\u308a\u306b\u304f\u3044&#8230; (\u304a\u3044)<\/p>\n<p><a href=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/22.png\" data-rel=\"lightbox-image-16\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img decoding=\"async\" src=\"http:\/\/1bed.allright.life\/wp-content\/uploads\/2016\/11\/22-277x300.png\" alt=\"\" \/><\/a><\/p>\n<h2>\u8003\u5bdf<\/h2>\n<p>\u7c97\u3005\u3067\u3059\u304c\u4e00\u901a\u308a\u8a66\u3057\u305f\u3044\u3053\u3068\u306f\u3067\u304d\u307e\u3057\u305f\uff01 Emotion API \u3092\u4f7f\u3048\u3070\u3001\u30cd\u30c3\u30c8\u304b\u3089\u7b11\u9854\u306e misono \u306e\u5199\u771f\u3092\u53d6\u5f97\u3059\u308b\u3068\u3044\u3046\u4ffa\u5f97\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u66f8\u3051\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u81ea\u5206\u304c\u5199\u3063\u305f\u904e\u53bb\u306e\u5199\u771f\u3092 Emotion API \u306b\u304b\u3051\u308b\u3053\u3068\u3067\u3001\u4eba\u751f\u3067\u4e00\u756a\u697d\u3057\u304b\u3063\u305f\u6642\u304c\u5224\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093(\u3053\u308c\u306f\u6016\u3044)<\/p>\n<p>\u4eca\u56de\u521d\u3081\u3066 NetOffice \u3092\u4f7f\u3063\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001Excel \u3060\u3051\u3067\u306f\u306a\u304f\u3001PowerPoint \u3084 Word \u3082\u6271\u3048\u308b\u3088\u3046\u3067\u3059\u306e\u3067\u3001\u53c8\u4f55\u304b\u3042\u3063\u305f\u3089\u4f7f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Cognitive Services \u3092\u4f7f\u3063\u3066\u4f55\u304b\u3084\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u3001\u6563\u6b69\u3057\u306a\u304c\u3089\u8003\u3048\u305f\u7d50\u679c\u3001Google Custom API \u3092\u4f7f\u3063\u3066\u753b\u50cf\u3092\u691c\u7d22\u3057\u3066\u3001\u305d\u306e\u753b\u50cf\u306e\u8868\u60c5\u3092 Microsoft Cogn [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68,6],"tags":[101,102,97,103,104,62],"class_list":["post-2363","post","type-post","status-publish","format-standard","hentry","category-cloudcompting","category-program","tag-cognitive-services","tag-emotion-api","tag-excel","tag-google-custom-search-api","tag-netoffice","tag-powershell"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2363"}],"version-history":[{"count":9,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2363\/revisions"}],"predecessor-version":[{"id":3138,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/2363\/revisions\/3138"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}