{"id":2194,"date":"2012-01-29T18:19:53","date_gmt":"2012-01-29T09:19:53","guid":{"rendered":"http:\/\/apr20.net\/?p=2194"},"modified":"2012-01-29T18:19:53","modified_gmt":"2012-01-29T09:19:53","slug":"facebook%e3%82%a2%e3%83%97%e3%83%aa%e3%80%80%e3%83%a6%e3%83%bc%e3%82%b6%e3%83%bc%e5%90%8d%e5%8f%96%e5%be%97%e3%83%bb%e8%a1%a8%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/apr20.net\/?p=2194","title":{"rendered":"Facebook\u30a2\u30d7\u30ea\u3000\u30e6\u30fc\u30b6\u30fc\u540d\u53d6\u5f97\u30fb\u8868\u793a"},"content":{"rendered":"<p>Facebook\u306eGraph API\u3092\u4f7f\u3063\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u540d\u4ee5\u5916\u306b\u3082\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u3067\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u60c5\u5831\u304c\u53d6\u5f97\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p>[php]https:\/\/graph.facebook.com\/USER_ID[\/php]<\/p>\n<p><a href=\"http:\/\/developers.facebook.com\/docs\/reference\/api\/\" target=\"_blank\">Facebook\u306eGraph API<\/a><\/p>\n<p>[php]&lt;?php <\/p>\n<p>    $app_id = \u30a2\u30d7\u30eaID;<br \/>\n    $app_secret = &quot;\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30ad\u30fc&quot;;<br \/>\n    $my_url = &quot;\u30b5\u30fc\u30d3\u30b9\u306eURL&quot;;<\/p>\n<p>    $code = $_REQUEST[&quot;code&quot;];<\/p>\n<p>    if(empty($code)) {<br \/>\n        $dialog_url = &quot;http:\/\/www.facebook.com\/dialog\/oauth?client_id=&quot;<br \/>\n            . $app_id . &quot;&amp;redirect_uri=&quot; . urlencode($my_url);<\/p>\n<p>        echo(&quot;&lt;script&gt; top.location.href=&#8217;&quot; . $dialog_url . &quot;'&lt;\/script&gt;&quot;);<br \/>\n    }<\/p>\n<p>    $token_url = &quot;https:\/\/graph.facebook.com\/oauth\/access_token?client_id=&quot;<br \/>\n        . $app_id . &quot;&amp;redirect_uri=&quot; . urlencode($my_url) . &quot;&amp;client_secret=&quot;<br \/>\n        . $app_secret . &quot;&amp;code=&quot; . $code;<\/p>\n<p>    $access_token = file_get_contents($token_url);<\/p>\n<p>    $graph_url = &quot;https:\/\/graph.facebook.com\/me?&quot; . $access_token;<\/p>\n<p>    $user = json_decode(file_get_contents($graph_url));<\/p>\n<p>    echo &quot;&lt;pre&gt;&quot;;<br \/>\n    \/\/\u30e6\u30fc\u30b6\u30fc\u540d\u4ee5\u5916\u306b\u3082\u3001\u3053\u3093\u306a\u60c5\u5831\u304c\u7c21\u5358\u306b\u53d6\u5f97\u51fa\u6765\u307e\u3059\u3002<br \/>\n    print_r($user);<br \/>\n    echo &quot;&lt;\/pre&gt;&quot;;<\/p>\n<p>    echo(&quot;\u30e6\u30fc\u30b6\u30fc\u540d\uff1a&quot; . $user-&gt;name);<\/p>\n<p>?&gt;[\/php]<\/p>\n<p><a href=\"http:\/\/developers.facebook.com\/docs\/authentication\/\" target=\"_blank\">Authentication<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Facebook\u306eGraph API\u3092\u4f7f\u3063\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2194","post","type-post","status-publish","format-standard","hentry","category-facebook-web"],"_links":{"self":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts\/2194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2194"}],"version-history":[{"count":0,"href":"https:\/\/apr20.net\/index.php?rest_route=\/wp\/v2\/posts\/2194\/revisions"}],"wp:attachment":[{"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apr20.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}