简体   繁体   中英

how to share in twitter like sharing some text in facebook using facebook javascript sdk

When someone clicks a button in my website, I am able to share some content to facebook using this:

FB.ui(
{
    method: 'feed',
    name: 'Facebook Dialogs',
    link: 'https://developers.facebook.com/docs/reference/dialogs/',
    picture: 'http://fbrell.com/f8.jpg',
    caption: 'Reference Documentation',
    description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
},
function(response) {
    if (response && response.post_id) {
    alert('Post was published.');
    } else {
    alert('Post was not published.');
    }
}
);

Is there anything similar to that for tweeting some content in twitter.

转至此处,了解有关Twitter API响应的更多信息https://dev.twitter.com/docs/error-codes-responses

The tweet Web Intent might be the most convenient analogue to your FB example.

This answer gives an example usage of a tweet web intent: https://stackoverflow.com/a/19426405/1637295

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM