开发者

share on facebook wall using api?

In my web application i need a simple functionality. i have a URL Link, there is a facebook button and user is prompted to share the url to his/her wall.

the similar shown in开发者_JS百科 the picture

share on facebook wall using api?


Just use window.open or such with the following format URL:

http://facebook.com/share.php?u=http://www.google.com

Shai.


 <script type="text/javascript">
        function streamPublish(name, description, hrefTitle, hrefLink, userPrompt){        
            FB.ui({ method : 'feed', 
                    message: userPrompt,
                    link   :  hrefLink,
                    caption:  hrefTitle,
                    picture: 'http://192.168.1.5/FrostBox1.0/photo/share_photo.jpg'
           });
           //http://developers.facebook.com/docs/reference/dialogs/feed/

        }
        function publishStream(){
            streamPublish("Stream Publish", 'Check my public link!', 'Public Link!', 'www.frostbox.com/link', "Public Link to my File");
        }

        function newInvite(){
             var receiverUserIds = FB.ui({ 
                    method : 'apprequests',
                    message: 'Come on man checkout my applications. visit http://ithinkdiff.net',
             },
             function(receiverUserIds) {
                      console.log("IDS : " + receiverUserIds.request_ids);
                    }
             );
             //http://developers.facebook.com/docs/reference/dialogs/requests/
        }
    </script>
</head>

<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
 <script type="text/javascript">
   FB.init({
     appId  : 'fffffffffff',
     status : true, // check login status
     cookie : true, // enable cookies to allow the server to access the session
     xfbml  : true  // parse XFBML
   });

 </script>



<a href="#" onClick="publishStream(); return false;">Publish Wall post using Facebook Javascript</a>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜