{"id":1554,"date":"2012-03-29T10:39:22","date_gmt":"2012-03-29T01:39:22","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=1554"},"modified":"2012-03-29T10:39:22","modified_gmt":"2012-03-29T01:39:22","slug":"%e6%bc%a2%e5%ad%97%e3%81%8b%e3%81%aa%e4%ba%a4%e3%81%98%e3%82%8a%e6%96%87%e3%82%92%e3%81%b2%e3%82%89%e3%81%8c%e3%81%aa%e3%81%ab%e3%81%99%e3%82%8b%e3%83%9e%e3%82%af%e3%83%ad","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=1554","title":{"rendered":"\u6f22\u5b57\u304b\u306a\u4ea4\u3058\u308a\u6587\u3092\u3072\u3089\u304c\u306a\u306b\u3059\u308b\u30de\u30af\u30ed"},"content":{"rendered":"<p><a href=\"http:\/\/developer.yahoo.co.jp\/webapi\/jlp\/furigana\/v1\/furigana.html\" title=\"Yahoo!\u30c7\u30d9\u30ed\u30c3\u30d1\u30fc\u30cd\u30c3\u30c8\u30ef\u30fc\u30af - \u30c6\u30ad\u30b9\u30c8\u89e3\u6790 - \u30eb\u30d3\u632f\u308a\" target=\"_blank\">Yahoo!\u306e\u30c6\u30ad\u30b9\u30c8\u89e3\u6790Web API(\u30eb\u30d3\u632f\u308a)<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3001\u6f22\u5b57\u304b\u306a\u4ea4\u3058\u308a\u6587\u3092\u3072\u3089\u304c\u306a\u306b\u3059\u308b\u30de\u30af\u30ed\u3067\u3059\u3002<\/p>\n<p>\u4e0b\u8a18\u30de\u30af\u30ed\u306fYahoo!\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u304c\u5fc5\u9808\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u300c<a href=\"http:\/\/help.yahoo.co.jp\/help\/jp\/developer\/developer-06.html\" title=\"\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u3068\u306f\" target=\"_blank\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u3068\u306f<\/a>\u300d\u300c<a href=\"http:\/\/help.yahoo.co.jp\/help\/jp\/developer\/developer-07.html\" title=\"\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u3092\u767b\u9332\u3059\u308b\" target=\"_blank\">\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u3092\u767b\u9332\u3059\u308b<\/a>\u300d\u3092\u53c2\u8003\u306b\u3001ID\u3092\u4e8b\u524d\u306b\u53d6\u5f97\u3057\u3066\u304f\u3060\u3055\u3044(\u53d6\u5f97\u5f8c\u30b3\u30fc\u30c9\u5185\u306e&#8221;<span style=\"color: #ff0000; font-weight: bold;\">ID<\/span>&#8220;\u306e\u5024\u3092\u5909\u66f4)\u3002<\/p>\n<p>\u306a\u304a\u3001API\u306e\u5236\u9650\u3067\u4e00\u65e550,000\u4ef6\u3092\u8d85\u3048\u308b\u3068\u51e6\u7406\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u70b9\u306f\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub Sample()\r\n  MsgBox GetFuriganaYahooApi(Selection.Text)\r\nEnd Sub\r\n\r\nPrivate Function GetFuriganaYahooApi(ByVal sentence As String, Optional ByVal grade As Long = 0)\r\n'\u6f22\u5b57\u304b\u306a\u4ea4\u3058\u308a\u6587\u3092\u3072\u3089\u304c\u306a\u306b\u3059\u308b\u30de\u30af\u30ed\r\n  Dim url As String\r\n  Dim d As Object\r\n  Dim sel As Object\r\n  Dim n As Object\r\n  Dim ret As String\r\n  \r\n  '\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\r\n  '\u8a73\u7d30\u306f&#x5B;http:\/\/help.yahoo.co.jp\/help\/jp\/developer\/developer-06.html]\u53c2\u7167\r\n  Const ID As String = &quot;(\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID)&quot;\r\n  \r\n  ret = &quot;&quot;: Set d = Nothing '\u521d\u671f\u5316\r\n  url = &quot;http:\/\/jlp.yahooapis.jp\/FuriganaService\/V1\/furigana&quot;\r\n  url = url &amp; &quot;?appid=&quot; &amp; ID &amp; &quot;&amp;sentence=&quot; &amp; EncodeURL(sentence)\r\n  Select Case grade\r\n    Case 1 To 8\r\n      url = url &amp; &quot;&amp;grade=&quot; &amp; CStr(grade)\r\n  End Select\r\n  On Error Resume Next\r\n  With CreateObject(&quot;MSXML2.XMLHTTP&quot;)\r\n    .Open &quot;GET&quot;, url, False\r\n    .Send\r\n    Set d = .responseXML\r\n  End With\r\n  On Error GoTo 0\r\n  If Not d Is Nothing Then\r\n    If d.SelectNodes(&quot;\/ResultSet\/Result\/WordList\/Word&quot;).Length &gt; 0 Then\r\n      For Each sel In d.SelectNodes(&quot;\/ResultSet\/Result\/WordList\/Word&quot;)\r\n        Set n = sel.SelectSingleNode(&quot;Furigana&quot;)\r\n        If Not n Is Nothing Then\r\n          ret = ret &amp; n.Text\r\n          Set n = Nothing\r\n        Else\r\n          ret = ret &amp; sel.SelectSingleNode(&quot;Surface&quot;).Text\r\n        End If\r\n      Next\r\n    End If\r\n  End If\r\n  GetFuriganaYahooApi = ret\r\nEnd Function\r\n\r\nPrivate Function EncodeURL(ByVal sWord As String) As String\r\n  With CreateObject(&quot;ScriptControl&quot;)\r\n    .Language = &quot;JScript&quot;\r\n    EncodeURL = .CodeObject.encodeURIComponent(sWord)\r\n  End With\r\nEnd Function<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/FuriganaService_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/FuriganaService_01-300x210.jpg\" alt=\"\" title=\"FuriganaService_01\" width=\"300\" height=\"210\" class=\"alignnone size-medium wp-image-1555\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/FuriganaService_01-300x210.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/FuriganaService_01-290x203.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/FuriganaService_01-150x105.jpg 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/FuriganaService_01.jpg 644w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u7cbe\u5ea6\u306f\u6b63\u76f4\u5fae\u5999\u306a\u3068\u3053\u308d\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u6587\u7ae0\u3092\u5b50\u3069\u3082\u5411\u3051\u306b\u5909\u63db\u3059\u308b\u969b\u306b\u306f\u5f79\u7acb\u3064\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Yahoo!\u306e\u30c6\u30ad\u30b9\u30c8\u89e3\u6790Web API(\u30eb\u30d3\u632f\u308a)\u3092\u4f7f\u7528\u3057\u3066\u3001\u6f22\u5b57\u304b\u306a\u4ea4\u3058\u308a\u6587\u3092\u3072\u3089\u304c\u306a\u306b\u3059\u308b\u30de\u30af\u30ed\u3067\u3059\u3002 \u4e0b\u8a18\u30de\u30af\u30ed\u306fYahoo!\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u304c\u5fc5\u9808\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u3068\u306f\u300d\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7 [&hellip;]","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48,49],"tags":[11],"class_list":["post-1554","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","tag-office-2"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-p4","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1554"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1554\/revisions"}],"predecessor-version":[{"id":1557,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1554\/revisions\/1557"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}