私はこのようなことを達成しようとしています.「XはYでゲームをしています」のようなものです.
私はこれに何時間も取り組んできましたが、私が作成したものはこの結果をもたらしません。Google や他のスタック オーバーフロー スレッドを検索しましたが、何も見つかりませんでした。これが私がすでに持っているコードです:
<script>
function publishStory() {
body = {
name: "<?php echo $userInfo['name']; ?> is playing <?php echo $game['name']; ?>",
link: "http://localhost",
caption: "I'm playing <?php echo $game['name']; ?> at http://localhost/",
message: "Wow! <?php echo $game['name']; ?> is amazing! Come play!",
source: 'http://localhost/static/flash.swf',
image: 'http://google.com/images/logo.gif',
"actions": [{"name":"Play <?php echo $game['name']; ?> now at Localhost","link":"localhost"}],
description: "The fascinating, compelling description"
}
FB.api('/me/feed', 'post', body, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Published to stream - you might want to delete it now!');
}
},
function(response) {
console.log('publishStory response: ', response);
});
return false;
}
</script>
そして、これがもたらす結果は次のとおりです。
ですから、ご覧のとおり、かなり異なります。「X が Y でゲームをプレイしている」というストーリーを公開する方法を教えてください。