FaceBook¤Î¥á¥â¡¢¥µ¥ó¥×¥ë¥¢¥×¥ê

­¡ ¥¿¥¤¥à¥é¥¤¥ó¤«¤éÌ᤹¡£¡Ê¥¦¥©¡¼¥ë¤Ë¡Ë

2012/3/24¤«¤éFaceBook¤Î¥¦¥©¡¼¥ë¤¬Çѻߤˤʤꡢ¥¿¥¤¥à¥é¥¤¥ó¤Ë¤Ê¤ë¡£
Ìñ²ð¤Ê¤Î¤Ï¡¢°ì¸«¡¢»î¸³±¿ÍÑÃæ¤È»×¤ï¤»¤ë¥¿¥¤¥à¥é¥¤¥ó¤Î¥×¥ì¥Ó¥å¡¼¤ò¤Ä¤Ä¤¤¤Æ¤·¤Þ¤¦¤È¡¢2Å٤ȡ¢¥¦¥©¡¼¥ë¤ËÌá¤ì¤Ê¤¯¤Ê¤ë¤³¤È¤À¡£
¤³¤ì¤Ï¡¢IE8°Ê¹ß¤¬³ºÅö¤¹¤ë¤é¤·¤¤¡£

¸½¾õ¤Î²óÈòºö¤È¤·¤Æ¤Ï¡¢IEµ¯Æ°¸å¡¢F12¤ÇIE¤Î³«È¯View¤òɽ¼¨¤·¤Æ¡¢
¥á¥Ë¥å¡¼¤Î¡Ö¥Ö¥é¥¦¥¶¥â¡¼¥É¡×¤òIE7¤ËÊѤ¨¤ë¤·¤«¤Ê¤¤¤é¤·¤¤¡£

3/24¤Ë¤Ï¤Ï¤Ã¤­¤ê¤·¤Þ¤¹¤¬
¿·¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏIE8°Ê¹ß¤·¤«Âбþ¤·¤Ê¤¤¤Î¤À¤í¤¦¤«¡£
MS¤â¡¢3·î¤«¤é¤ÎWindowsUpdate¤Ç̵¾ò·ï¤ËIE8²½¤ò¤¹¤ë¤é¤·¤¤¤Î¤Ç¡¢
¤³¤ì¤ËÊ»¤»¤¿¤È¤¤¤¦¤³¤È¤À¤í¤¦¤«¡£


-------
­¢ Win7¡ÜIE9¤Ç¿®ÍêºÑ¤ß¥µ¥¤¥È¤ËÀßÃÖ¤·¤¿¡Ö¤¤¤¤¤Í¥Ü¥¿¥ó¡×¤¬¤¦¤Þ¤¯µ¡Ç½¤·¤Ê¤¤¡£

°ìÈÌŪ¤Ë¤Ï
http://developers.facebook.com/docs/reference/plugins/like/
¤Ç¡¢Like¥Ü¥¿¥ó¤Î¤Ò¤Ê·¿¤òºîÀ®¤·¤Æ¡¢HP¤ËÄ¥¤êÉÕ¤±¤Þ¤¹¡£

¥Í¥Ã¥È¥ï¡¼¥¯¾ò·ï¤Ï¼ï¡¹ÍÍ¡¹¤Ç¤¢¤ë¤Î¤Ç°ì³µ¤Ë¸À¤¨¤Þ¤»¤ó¤¬¡¢
Win7+IE9¤ÎÁȤ߹ç¤ï¤»¤Ç¡¢¿®ÍêºÑ¤ß¥µ¥¤¥È¤ËÀßÃÖ¤·¤¿¡Ö¤¤¤¤¤Í¥Ü¥¿¥ó¡×¤ò²¡¤¹¤È
http://www.facebook.com/connect/connect_to_external_page_widget_loggedin.php?social_plugin=like&external_page_url=<»ØÄê¤Îurl>#_=_
¤Î¥Ö¥é¥ó¥¯¥Ú¡¼¥¸¤¬³«¤¤¤Æ¤·¤Þ¤¦¡£
Ä̾ï¤Ê¤é¡¢¥³¥á¥ó¥ÈÆþÎϤ¬¸½¤ì¤ë¤Ï¤º¤À¡£

ÂÌÌܤʾì¹ç¤Ë¤Ï¾å¤Ç½ñ¤¤¤¿¡¢F12¤ÇIE7¸ß´¹¤ËÊѤ¨¤Æ¤â¼ºÇÔ¤¹¤ë¡£
http://developers.facebook.com/tools/lint/
¤Ç¤âÆäËÌäÂê¤Ï¸¡½Ð¤µ¤ì¤Ê¤¤¡£

¥Ù¡¼¥¿ÈǤÎWin8CP+IE10¤À¤È¾¯¤·Ê£»¨¤Ç
¡¦¥á¥È¥íÈÇ¡¦¡¦¡¦¥Ö¥é¥ó¥¯¥Ú¡¼¥¸¤¬³«¤¯¡£
¡¦DeskTopÈÇ¡¦¡¦¡¦¥Ö¥é¥ó¥¯¤Ï½Ð¤º¡¢¤¤¤¤¤Í¤â²¡¤»¤ë¤¬¡¢¥³¥á¥ó¥È¤¬³«¤«¤Ê¤¤¡£

¾¯¤Ê¤¯¤È¤â¡¢¥¤¥ó¥È¥é´Ä¶­²¼¤Ç¤Ï¡Ö¤¤¤¤¤Í¡×¤ò»È¤ï¤Ê¤¤Êý¤¬Îɤµ¤½¤¦¤À¡£


-------
­£ FaceBook¥µ¥ó¥×¥ë¥¢¥×¥ê javaScript SDK¤Çuser¾ðÊó¤Îɽ¼¨

(2012.8)¸½ºß¡¢¤³¤ÎÊýË¡¤Çuser¾ðÊó¤Ïɽ¼¨¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿¡£

¥í¥°¥ª¥ó¤·¤Æ¤¤¤ë¤³¤È¤¬¾ò·ï¤Ë¤Ê¤ë¤¬¡¢
¥í¥°¥ª¥ó¤·¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢¡Ö¤¤¤¤¤Í¡×¤ò²¡¤¹¤È¥í¥°¥ª¥ó¤¬Í׵ᤵ¤ì¤ë¡£
¤³¤Î»þ¤ËºÆÅÙ¡¢FB.init()¤ò¸Æ¤Ó½Ð¤·¤Æuser¾ðÊó¤ò¼èÆÀ¤Ç¤­¤¿¡£

¤¤¤º¤ì¤Ë¤·¤Æ¤â¡¢¥æ¡¼¥¶¡¼¤Ëµ¤¤Å¤«¤ì¤º¤Ë¡¢
FaceBook¤Îuser¾ðÊ󤬼èÆÀ¤Ç¤­¤Æ¤·¤Þ¤¦¤³¤È¤Ï¡¢¤È¤Æ¤â´í¸±¤À¡£

DeveropperÅÐÏ¿¤·¤Æ¥¢¥×¥êID¤ò¼èÆÀ¤¹¤ì¤Ð¡¢FaceBook¤ÎSDK¤ò»È¤Ã¤¿¥Ú¡¼¥¸¤¬¹¥¤­¤ÊHP¾å¤Ë¹½ÃۤǤ­¤ë¡£
FaceBook¥­¥ã¥ó¥Ð¥¹¤Ï¡¢https:¤Î¥¢¥É¥ì¥¹¤¬É¬ÍפÀ¤¬¡¢
FaceBook¥­¥ã¥ó¥Ð¥¹¤òÍøÍѤ·¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢¤É¤³¤Ë¤Ç¤âÃÖ¤±¤ë¡£
¤Ä¤Þ¤ê¡¢ÌîÎÉ¥¢¥×¥ê¤Ç¤¢¤ë¡£
˺¤ì¤½¤¦¤Ê¤Î¤Ç¥á¥â¡£

°ìÈÌŪ¤Ê¡Ö¤¤¤¤¤Í¥Ü¥¿¥ó¡×¤òÇÛÃÖ¤¹¤ë¡¢¼¡¤Î¤è¤¦¤Êhtml¤òÍÑ°Õ¤¹¤ë¡£


<!DOCTYPE html>

<!--- xmlns¤Ï¡¢IEÉÔ¶ñ¹ç¤Î¤ª¤Þ¤¸¤Ê¤¤¡¢¤Û¤È¤ó¤É¸ú²Ì¤Ï¤Ê¤¤ --->
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<!--- ¤³¤³¤Î¥á¥¿Éô¤Ï¡¢¤¤¤¤¤Í¥Ü¥¿¥ó¤Ç¤Î¤ßɬÍפʤâ¤Î¤Ç¤¹¡£ --->
<meta property="og:title" content="xxxxxx" />
<meta property="og:type" content="xxxxx" />
<meta property="og:url" content="http://www.xxxxxxxxxx.xx.xx/" />
<meta property="og:image" content="http://www.xxxxxxxxx.xx.xx/xxxx.gif" />
<meta property="og:site_name" content="xxxxxx" />
<meta property="fb:admins" content="nnnnnnnnnnnnnnn" />
<!--- ¤¤¤¤¤Í¥á¥¿ ¤³¤³¤Þ¤Ç¡£ --->

</head>
<body>

<!--- FaceBook¥¢¥×¥ê --->
<div id="fb-root"></div>
<script script type="text/javascript" src="http://www.xxxxxxxxxxx.xx.xx/core.js"></script>
<!--- FaceBook¥¢¥×¥ê ¤³¤³¤Þ¤Ç¡£ --->

<!--- ¤è¤¦¤³¤½¡§£ø£ø¤µ¤ó --->
<div id="username"></div>

<!--- ¥æ¡¼¥¶¡¼¾ðÊóɽ¼¨Éô --->
<div id="userinf"></div>

<!--- ͧ¿Í¾ðÊóɽ¼¨Éô --->
<div id="friendinfo"></div>
<br />

<!--- ¤¤¤¤¤Í¥Ü¥¿¥ó --->
<div id="iinebutton"></div>

</body>
</html>



channel.html¤Ï¡¢
https://developers.facebook.com/docs/reference/javascript/
¤Ë¤¢¤ëÄ̤ꡢ

<script src="//connect.facebook.net/en_US/all.js"></script>
¤Î°ì¹Ô¤À¤±¡£

³¤¤¤Æ¡¢FaceBook¥¢¥×¥ê¤Îcore.js¤ò¼¡¤Î¤è¤¦¤Ë½ñ¤¯¡£


// Copyright(C) Hundredsoft Corporation 2012 All rights reserved. 
//
//  FaceBook¥¢¥¯¥»¥¹¥µ¥ó¥×¥ë (javascript SDK)  core.js
//
//   2012.3 »þÅÀ¤Ç°ÕÌ£¤¬¤¢¤Ã¤Æ¡¢¤«¤ÄBasic Permission¤Ç°ú¤±¤½¤¦¤Ê¹àÌܤòʤ٤¿
//

var m_login = false;

window.fbAsyncInit = function() {
   FB.init({
      appId      : 'xxxxxxxxxxxxxxx', // App ID
      channelUrl : 'channel.html', // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
   });

   // Additional initialization code here

   // Async¤Î¾ì¹ç¡¢¤¤¤¤¤Í¤ÏSDKÆɤ߹þ¤ß¸å¤Ëºî¤é¤Ê¤¤¤ÈÆüËܸì¤Ë¤Ê¤é¤Ê¤¤
   document.getElementById("iinebutton").innerHTML = '<div class="fb-like" data-href="http://www.xxxxxxxxxxx.xx.xx/" data-send="true" data-width="450" data-show-faces="true"></div>';

   FB.getLoginStatus(function(response){
      if (response.status === 'connected') {
         // Logged in
         m_login = true;
         showUser();
      }
      else{
         //ËÜÍè¤Ï¤³¤³¤ÇFB.login¤Ç¥í¥°¥¤¥óWindow¤ò½Ð¤µ¤»¤ë¡£
         //º£²ó¤Ï¥æ¡¼¥¶¤ÎÊÌÁàºî¤Ç¥í¥°¥¤¥ó¤µ¤»¤ë¤¿¤á¡¢Ìµ½èÍý¡£
      }
   });

   // ¤¤¤¤¤Í¤ò²¡¤·¤¿¤È¤­¸Æ¤Ð¤ì¤ë
   FB.Event.subscribe('edge.create', function (response) {
      if (!m_login){
         //¤Á¤ç¤Ã¤È̵Íý¤µ¤»¤Þ¤¹¡£
         FB.init({
            appId      : 'xxxxxxxxxxxxxxx', // App ID
            channelUrl : 'channel.html', // Channel File
            status     : true, // check login status
            cookie     : true, // enable cookies to allow the server to access the session
            xfbml      : true  // parse XFBML
         });

         FB.getLoginStatus(function(response){
            if (response.status === 'connected') {
               // Logged in
               m_login = true;
               showUser();
            }
         });
      }
   });
};

function showUser(){
   FB.api('/me', function(response){
      //ÆüËܸì̾¾Î¤Ï,user¥Æ¡¼¥Ö¥ë¤Ç¤Ï¤Ê¤¯,profile¡£¤·¤«¤·¸¢¸ÂÄɲä¬É¬Íס£
      document.getElementById("username").innerHTML = '<h2>¤è¤¦¤³¤½¡§' + response.name + ' ¤µ¤ó</h2>';

      var query = FB.Data.query('select uid, name, profile_url, sex, email, current_location, hometown_location, work_history, education_history, hs_info, pic_small from user where uid={0}', response.id);
      query.wait(function(rows) {
         var name_e = (rows[0].name!= undefined ?        rows[0].name : "");
         var url =    (rows[0].profile_url!= undefined ? rows[0].profile_url : "");
         var email =  (rows[0].email!= undefined ?       rows[0].email : "");
         var pic_e =  (rows[0].pic_small!= undefined ?   rows[0].pic_small : "");

         var current_loc = "";
         if (rows[0].current_location!= undefined){
             current_loc = (rows[0].current_location.city!= undefined ? rows[0].current_location.city : "") + "," +
                           (rows[0].current_location.state!= undefined ? rows[0].current_location.state : "") + "," +
                           (rows[0].current_location.country!= undefined ? rows[0].current_location.country : "");
         }
         var hometown = "";
         if (rows[0].hometown_location!= undefined){
             hometown = (rows[0].hometown_location.city!= undefined ? rows[0].hometown_location.city : "") + "," +
                        (rows[0].hometown_location.state!= undefined ? rows[0].hometown_location.state : "") + "," +
                        (rows[0].hometown_location.country!= undefined ? rows[0].hometown_location.country : "");
         }
         var highsc = "";
         if (rows[0].hs_info!= undefined){
             highsc = (rows[0].hs_info.hs1_name!= undefined ? rows[0].hs_info.hs1_name : "");
         }
         var edname = "";
         if (rows[0].education_history!= undefined){
             if (rows[0].education_history[0]!= undefined){
                edname = (rows[0].education_history[0].name!= undefined ? rows[0].education_history[0].name : "");
             }
         }
         var wkname = "";
         if (rows[0].work_history!= undefined){
             if (rows[0].work_history[0]!= undefined){
                wkname = (rows[0].work_history[0].company_name!= undefined ? rows[0].work_history[0].company_name : "");
             }
         }

         var jsex = "";
         if (rows[0].sex!= undefined){
            if (rows[0].sex == "female"){
               jsex = "½÷À­";
            }else{
               jsex = "ÃËÀ­";
            }
         }
         document.getElementById('userinf').innerHTML =  
            '̾Á°: '   +  name_e                                                    + "<br />" +
            'À­ÊÌ: '   +  jsex                                                      + "<br />" +
            'URL : '   +  '<a href="' + url + '" target="_blank">' + url + '</a>'   + "<br />" +
            'Mail: '   +  (email!= undefined ? email : "")                          + "<br />" +
            '½»½ê: '   +  current_loc                                               + "<br />" +
            'ÅļË: '   +  hometown                                                  + "<br />" +
            '²ñ¼Ò: '   +  wkname                                                    + "<br />" +
            'Âç³Ø: '   +  edname                                                    + "<br />" +
            '¹â¹»: '   +  highsc                                                    + "<br />" +
               '<img src="' +  pic_e + '" width="50" />' + "<br /><br /><br />";
      });

      showFriend();
   });
}


function showFriend(){
   FB.api('/me/friends', function(response){
      var users = "";
      var i;
      for(i=0;i<response.data.length;i++){
         var f_id = (response.data[i].id!= undefined ?   response.data[i].id : "");
         var f_name = (response.data[i].name!= undefined ?   response.data[i].name : "");
         users = users + '<a href="http://www.facebook.com/profile.php?id=' + f_id + '" target="_blank"><img src="http://graph.facebook.com/' + f_id + '/picture" width="50" />' + f_name + '</a>&nbsp;&nbsp;&nbsp;&nbsp;';
      }
      document.getElementById("friendinfo").innerHTML = '¸½ºß¤Îͧ¿Í¤Ï¡¢' + i + ' ¿Í¤Ç¤¹¡£<br />' + users;
   });
}

// Load the SDK Asynchronously
// ja-JP¤ËÊѤ¨¤Ê¤¤¤È,¤¤¤¤¤Í¤¬ÆüËܸì¤Ë¤Ê¤é¤Ê¤¤
//
(function(d){
   var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/ja_JP/all.js";
   ref.parentNode.insertBefore(js, ref);
}(document));



¤³¤Î£³¤Ä¤Î¥Õ¥¡¥¤¥ë¤òŬÅö¤ÊHP¤ËÃÖ¤±¤Ð¡¢FaceBook¾ðÊó¤òɽ¼¨¤·¤Æ¤¯¤ì¤ë¡£

¤³¤Á¤é¤Ë¥µ¥ó¥×¥ë¤òÃÖ¤¤¤Æ¤ª¤­¤Þ¤¹¡£
IE¤À¤È¡Ö¤¤¤¤¤Í¡×¤ò²¡¤·¤Æ¥í¥°¥ª¥ó¤·¤Æ¤â¾ðÊó¤¬É½¼¨¤µ¤ì¤Ê¤¤¤È¤­¤¬¤¢¤ë¤Î¤Ç¡¢
¤½¤Î»þ¤Ï¥ê¥í¡¼¥É(ºÆÆɤ߹þ¤ß)¤·¤Æ¤¯¤À¤µ¤¤¡£




Tags: ¥×¥í¥°¥é¥à¥á¥â¡¡VirtualPC´ØÏ¢¡¡Windows7(x64)´ØÏ¢
author : HUNDREDSOFT | - | -