Twitter Tweet or ReTweet Callbacks

后端 未结 3 1054
眼角桃花
眼角桃花 2021-01-07 09:26

Hope you are having a good time. I am creating a website where when users Tweet a wordpress blog entry then they get points on the websites.

So basically, if a user

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-07 10:10

    using Twitters @anywhere api, you can set an onTweet function that does something when someone tweets.

    here is a 6-step tutorial, see number 4

    A default tweetBox can be called after the element with the comments class with the following snippet.

    twttr.anywhere(function(twitter) {
        twitter(".comments").tweetBox();
    });
    

    So if you want a custom label, content, and a callback when the tweet has been sent, use this code.

    twitter(".comments").tweetBox({
        label: 'What do you think about this article?',
        defaultContent: '#nettuts ',
        onTweet: function(plain, html){
            // Actions when tweet is sent
        }
    });
    

提交回复
热议问题