{"id":1115,"date":"2011-09-11T02:18:39","date_gmt":"2011-09-10T17:18:39","guid":{"rendered":"http:\/\/codaholic.org\/?p=1115"},"modified":"2011-09-11T02:18:39","modified_gmt":"2011-09-10T17:18:39","slug":"phptwitter-api%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%a6%e7%89%b9%e5%ae%9a%e3%81%ae%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e3%81%ae%e3%83%95%e3%82%a9%e3%83%ad%e3%83%bc%e3%81%97%e3%81%a6%e3%81%84","status":"publish","type":"post","link":"https:\/\/codaholic.org\/?p=1115","title":{"rendered":"[PHP]Twitter API\u3092\u5229\u7528\u3057\u3066\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308bID\u4e00\u89a7\u3068\u30d5\u30a9\u30ed\u30ef\u30fc\u306eID\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>Twitter\u3067\u306f\u3042\u308b\u7279\u5b9a\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u3068\u3001\u305d\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3053\u3068\u3092\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3092Twitter API\u3092\u4f7f\u3063\u3066\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u30d5\u30a9\u30ed\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u3068\u30d5\u30a9\u30ed\u30ef\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u306f\u5225\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u5148\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u79c1\u306eTwitter\u30a2\u30ab\u30a6\u30f3\u30c8(@suzukit86)\u306b\u3064\u3044\u3066\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092JSON\u3067\u53d7\u3051\u53d6\u308b\u5834\u5408\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u5148\u306f\u305d\u308c\u305e\u308c\u4e0b\u8a18\u306b\u306a\u308a\u307e\u3059\u3002\u306a\u304a\u3001\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u306fJSON\u306e\u30c7\u30b3\u30fc\u30c9\u306b<a href=\"http:\/\/pear.php.net\/pepr\/pepr-proposal-show.php?id=198\" target=\"_blank\">Services_JSON<\/a>\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30d5\u30a9\u30ed\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u5148<br \/>\nhttp:\/\/api.twitter.com\/1\/friends\/ids.json?screen_name=suzukit86<\/p>\n<p>\u30d5\u30a9\u30ed\u30ef\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u30ea\u30af\u30a8\u30b9\u30c8\u5148<br \/>\nhttp:\/\/api.twitter.com\/1\/followers\/ids.json?screen_name=suzukit86<\/p>\n<p>\u4e0a\u8a18\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u5148\u306bGET\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057\u3066\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092JSON\u30c7\u30b3\u30fc\u30c9\u3059\u308b\u3053\u3068\u3067\u7d50\u679c\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4e0b\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f@suzukit86\u306e\u30d5\u30a9\u30ed\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306eID\u4e00\u89a7\u3068\u30d5\u30a9\u30ed\u30ef\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u306eID\u4e00\u89a7\u3092\u5358\u7d14\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<p>[php]<br \/>\n<?php\n\t\n\tinclude 'JSON.php';\n\t$json = new Services_JSON;\n\t\n\t$my_screen_name = 'suzukit86';\n\t\n\t\/\/@suzukit86\u304c\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u306eID\u4e00\u89a7\n\t$url = 'http:\/\/api.twitter.com\/1\/friends\/ids.json?screen_name=' . $my_screen_name;\n\t$response = file_get_contents($url);\n\t$follows = $json->decode($response);<\/p>\n<p>\tforeach($follows as $x){<br \/>\n\t\tprint $x . &#8216;<br \/>&#8216;;<br \/>\n\t}<\/p>\n<p>\tprint &#8216;<\/p>\n<p>&#8216;;<\/p>\n<p>\t\/\/@suzukit86\u3092\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8ID\u306e\u4e00\u89a7<br \/>\n\t$url = &#8216;http:\/\/api.twitter.com\/1\/followers\/ids.json?screen_name=&#8217; . $my_screen_name;<br \/>\n\t$response = file_get_contents($url);<br \/>\n\t$followers = $json->decode($response);<\/p>\n<p>\tforeach($followers as $y){<br \/>\n\t\tprint $y . &#8216;<br \/>&#8216;;<br \/>\n\t}<\/p>\n<p>?><br \/>\n[\/php]<\/p>\n<p>\u3053\u306eAPI\u3067\u306f\u30a2\u30ab\u30a6\u30f3\u30c8\u306eID\u3057\u304b\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3059\u3002\u3064\u307e\u308a\u30b9\u30af\u30ea\u30fc\u30f3\u30cd\u30fc\u30e0\u3060\u3063\u305f\u308a\u30a2\u30a4\u30b3\u30f3\u306eURL\u3060\u3063\u305f\u308a\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u305d\u308c\u305e\u308c\u306eID\u3067\u6539\u3081\u3066\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Twitter\u3067\u306f\u3042\u308b\u7279\u5b9a\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304c\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u3068\u3001\u305d\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3053\u3068\u3092\u30d5\u30a9\u30ed\u30fc\u3057\u3066\u3044\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u4e00\u89a7\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3092Twitter API\u3092\u4f7f\u3063\u3066\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[4,34],"tags":[257,244,256],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gd1W-hZ","_links":{"self":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1115"}],"collection":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1115"}],"version-history":[{"count":4,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1115\/revisions"}],"predecessor-version":[{"id":1119,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1115\/revisions\/1119"}],"wp:attachment":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}