{"id":278,"date":"2012-06-03T23:56:34","date_gmt":"2012-06-03T14:56:34","guid":{"rendered":"http:\/\/1bed.allright.life\/?p=278"},"modified":"2020-04-18T23:37:39","modified_gmt":"2020-04-18T14:37:39","slug":"post-278","status":"publish","type":"post","link":"https:\/\/1bed.allright.life\/?p=278","title":{"rendered":"\u5f62\u614b\u7d20\u89e3\u6790(Yahoo API)"},"content":{"rendered":"<p>\u4eca\u66f4\u306a\u304c\u3089 Twitter bot \u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u304b\u306a\u3063\u3068\u601d\u3063\u305f\u3053\u3068\u3068\u3001\u524d\u306b\u5f8c\u8f29\u304c\u51fa\u5411\u306b\u884c\u3063\u3066\u3044\u305f\u5f62\u614b\u7d20\u89e3\u6790\u3063\u3066\u4f7f\u3063\u3066\u307f\u305f\u3044\u306a\u3063\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u307e\u305a\u306f\u6c17\u8efd\u306b\u4f7f\u3048\u305d\u3046\u306a Yahoo API \u306e\u5f62\u614b\u7d20\u89e3\u6790\u3092\u4f7f\u3063\u3066\u307f\u305f\u3002 \u3061\u306a\u307f\u306b Yahoo ID \u5fc5\u9808\u3002<\/p>\n<h3>1. \u4e0b\u8a18\u306e\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3ID\u306e\u767b\u9332(\u7121\u6599)\u300d\u3092\u9078\u3076<\/h3>\n<p><a href=\"http:\/\/developer.yahoo.co.jp\/webapi\/jlp\/ma\/v1\/parse.html\">\u25a1\u65e5\u672c\u8a9e\u5f62\u614b\u7d20\u89e3\u6790<\/a><\/p>\n<h3>2. \u5b9f\u969b\u306b\u8a66\u3057\u3066\u307f\u308b<\/h3>\n<pre><code class=\"language-php\">&lt;?php\n$format=&#039;http:\/\/jlp.yahooapis.jp\/MAService\/V1\/parse?appid=%s&amp;sentence=%s&#039;;\n$apikey = YahooAPI\u306e\u30ad\u30fc;\n$msg = &#039;\u4eca\u65e5\u306f\u6674\u308c\u306b\u306a\u308b\u3068\u3044\u3044\u306a&#039;;\n$url = sprintf($format, $apikey, $msg);\n$rss = file_get_contents($url);\n$xml = simplexml_load_string($rss);<\/code><\/pre>\n<h3>3. \u7d50\u679c\u3092 var_dump \u3059\u308b<\/h3>\n<pre><code class=\"language-php\">&lt;?php\nobject(SimpleXMLElement)#202 (1) {\n  [&quot;ma_result&quot;]=&gt;\n  object(SimpleXMLElement)#201 (3) {\n    [&quot;total_count&quot;]=&gt;\n    string(1) &quot;8&quot;\n    [&quot;filtered_count&quot;]=&gt;\n    string(1) &quot;8&quot;\n    [&quot;word_list&quot;]=&gt;\n    object(SimpleXMLElement)#200 (1) {\n      [&quot;word&quot;]=&gt;\n      array(8) {\n        [0]=&gt;\n        object(SimpleXMLElement)#199 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(6) &quot;\u4eca\u65e5&quot;\n          [&quot;reading&quot;]=&gt;\n          string(9) &quot;\u304d\u3087\u3046&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u540d\u8a5e&quot;\n        }\n        [1]=&gt;\n        object(SimpleXMLElement)#198 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(3) &quot;\u306f&quot;\n          [&quot;reading&quot;]=&gt;\n          string(3) &quot;\u306f&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u52a9\u8a5e&quot;\n        }\n        [2]=&gt;\n        object(SimpleXMLElement)#197 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(6) &quot;\u6674\u308c&quot;\n          [&quot;reading&quot;]=&gt;\n          string(6) &quot;\u306f\u308c&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u540d\u8a5e&quot;\n        }\n        [3]=&gt;\n        object(SimpleXMLElement)#196 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(3) &quot;\u306b&quot;\n          [&quot;reading&quot;]=&gt;\n          string(3) &quot;\u306b&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u52a9\u8a5e&quot;\n        }\n        [4]=&gt;\n        object(SimpleXMLElement)#195 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(6) &quot;\u306a\u308b&quot;\n          [&quot;reading&quot;]=&gt;\n          string(6) &quot;\u306a\u308b&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u52d5\u8a5e&quot;\n        }\n        [5]=&gt;\n        object(SimpleXMLElement)#194 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(3) &quot;\u3068&quot;\n          [&quot;reading&quot;]=&gt;\n          string(3) &quot;\u3068&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u52a9\u8a5e&quot;\n        }\n        [6]=&gt;\n        object(SimpleXMLElement)#193 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(6) &quot;\u3044\u3044&quot;\n          [&quot;reading&quot;]=&gt;\n          string(6) &quot;\u3044\u3044&quot;\n          [&quot;pos&quot;]=&gt;\n          string(9) &quot;\u5f62\u5bb9\u8a5e&quot;\n        }\n        [7]=&gt;\n        object(SimpleXMLElement)#192 (3) {\n          [&quot;surface&quot;]=&gt;\n          string(3) &quot;\u306a&quot;\n          [&quot;reading&quot;]=&gt;\n          string(3) &quot;\u306a&quot;\n          [&quot;pos&quot;]=&gt;\n          string(6) &quot;\u52a9\u8a5e&quot;\n        }\n      }\n    }\n  }\n}<\/code><\/pre>\n<p>\u7c21\u5358\u306b\u8a66\u305b\u308b\u306e\u3067\u3044\u3044\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u66f4\u306a\u304c\u3089 Twitter bot \u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u304b\u306a\u3063\u3068\u601d\u3063\u305f\u3053\u3068\u3068\u3001\u524d\u306b\u5f8c\u8f29\u304c\u51fa\u5411\u306b\u884c\u3063\u3066\u3044\u305f\u5f62\u614b\u7d20\u89e3\u6790\u3063\u3066\u4f7f\u3063\u3066\u307f\u305f\u3044\u306a\u3063\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u307e\u305a\u306f\u6c17\u8efd\u306b\u4f7f\u3048\u305d\u3046\u306a Yahoo API \u306e\u5f62\u614b\u7d20\u89e3\u6790\u3092\u4f7f\u3063\u3066\u307f\u305f\u3002 \u3061\u306a\u307f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[7,45,28],"class_list":["post-278","post","type-post","status-publish","format-standard","hentry","category-program","tag-php","tag-yahoo-api","tag-28"],"_links":{"self":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/278","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=278"}],"version-history":[{"count":23,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/278\/revisions"}],"predecessor-version":[{"id":3230,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=\/wp\/v2\/posts\/278\/revisions\/3230"}],"wp:attachment":[{"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1bed.allright.life\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}