Post zu facebook Wand, durch meine website

Geben, wenn ich etwas, was auf ein Textfeld und ein Bild hochladen und Einreichen, Die post soll post in der besonders Benutzer der facebook-timeline.Dies ist der code, den ich geschrieben habe, aber itz nicht funktioniert:

<html>
<head>
<script src='http://connect.facebook.net/en_US/all.js'></script>
</head>
<body>
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
  FB.init({
    appId      : 'App ID', //App ID
    channelUrl : '//mynetwork.net/', //Channel File
    status     : true, //check login status
    cookie     : true, //enable cookies to allow the server to access the session
    xfbml      : true  //parse XFBML
  });

  FB.Event.subscribe('auth.authResponseChange', function(response) {
    if (response.status === 'connected') {
      testAPI();
    } else if (response.status === 'not_authorized') {
      FB.login();
    } else {
      FB.login();
    }
  });
  };

  (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/en_US/all.js";
   ref.parentNode.insertBefore(js, ref);
  }(document));

  function testAPI() {
    console.log('Welcome!  Fetching your information.... ');
    FB.api('/me', function(response) {
      console.log('Good to see you, ' + response.name + '.');
    });
  }
</script>

<script>
var params = {};
params['message'] = 'Message eqwe';
params['name'] = 'wqe wqeweq Name';
params['description'] = 'wqe wDescription';
params['link'] = 'https://www.facebook.com/nvidarshana?fref=ts';
params['picture'] = 'http://summer-mourning.zoocha.com/uploads/thumb.png';
params['caption'] = 'Caption';

FB.api('/me/feed', 'post', params, function(response) {
  if (!response || response.error) {
    console.log(response.error);
    alert(response.error);
  } else {
    alert('Published to stream - you might want to delete it now!');
  }
});
</script>

<fb:login-button show-faces="true" width="200" max-rows="1"></fb:login-button>
</body>
</html>

Ich habe aktualisiert mein code, noch wie man den Fehler

"Object {Meldung: "An active access token muss verwendet werden, zur Abfrage von Informationen über den aktuellen Benutzer.", Typ: "OAuthException", " code: 2500} "

InformationsquelleAutor nanbatman | 2013-10-03
Schreibe einen Kommentar