Search code examples
twittertwitter4j

retweeting by twitter.com/intent/retweet vs twitter4j


I want to add retweet button to my website and I have two option:

I can create application in twitter and go through all steps and when user click retweet he should first authorize my app then after his authorization I can use twitter4j to retweet on his account

BUT:

the simpler way is to use this the following:

<a href='https://twitter.com/intent/retweet?tweet_id=111111111<</a>

which works perfectly. the thing that I am wondering now what is the different between the two. When I can use the second approach which is easier why should I use the first approach? is there any advantage that the first approach has and the second does not have?


Solution

  • Difference is in User Interaction:

    API:

    Retweet is an important feature, so it will be there in API. Applications built based on twitter API NEED this.

    Once user authorizes the app, you can write a function which automates retweeting when the tweet contains certain words, etc. It needs no user interaction.

    URL:

    https://twitter.com/intent/retweet?tweet_id=111111111

    https://dev.twitter.com/docs/intents#retweet-intent

    This needs user interaction. Clicking this link opens a popup where user HAVE to click a button to do the required action.