English 中文(简体)
FB 附有违约观察行动的开放式制图不可行
原标题:FB Open Graph script with default Watch action does not work

//Update: With help I managed to catch some errors which fixed the token issue. I ve updated the code to reflect that. The code still doesn t produce an event on the timeline though so I m leaving the question up.

原件问题:

我试图用开放图普软件制作一个简单的文字,在访问者打上这一页后,将连接到Facebook的参观网页(包括一部电影)。

I m not using a custom action and object, but the standard Watch action (https://developers.facebook.com/docs/opengraph/video/) and Video.movie object.

I came up with this based on FB s example code:

<!-- first login-button with scope publish_actions: -->
<fb:login-button show-faces="false" width="200" max-rows="1" scope="publish_actions"    ></fb:login-button>

<!-- Then script that should push update to timeline: -->
<script type="text/javascript">
    function fbPublish(){
        FB.api(
         /me/video.watches ,
         post ,
        {  video.movie :  <?php the_permalink(); ?> ,
         access_token :  blablabla   },
        function(response) {
           if (!response || response.error) {
              alert( Nope. );
           } else {
              alert( Yes. ); // any stuff
           }
        });
    }

这触发了Nope警报。

I have added the Watch action through curl. Any ideas as to what could be going on?

问题回答

您仍然需要FB.login,然后才能自动张贴到用户的时间。

FB.login(function(response) {
      // Post the action
 }, {scope:  publish_actions });

While I didn t check the validity of your actual code to post the action, you problem is that before you can do this, you ll need the user s permission. The publish_actions permission is the one you ll need but I think its already included in new Auth Dialogs. Just leave it there to be sure.

不管先是FB.login代码,你们的伤员会获得“低”方言,然后是你能够自由站在用户墙上的时候。 作为安全的一部分,Facebook用户希望你在时间上张贴,而不知道。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签