Getting Tweet ID of a particular tweet

前端 未结 1 1306
自闭症患者
自闭症患者 2021-01-23 03:53

On my site I\'ve added a Tweet button. What I want to do is whenever user clicks on that button and the tweet gets posted on user\'s twitter account, I want to catch the unique

1条回答
  •  温柔的废话
    2021-01-23 04:30

    When calling the REST API (http://api.twitter.com/1/statuses/update.json -- or whichever format), you get back the ID string. However, it also implies that you must route everything through your server using oAuth.

    Alternatively, you could use the JavaScript API, along with one of the official Twitter JS widgets, and create an event listener to catch the tweet event. From there, you should have appropriate information in the data field of the event (something like evt.data), which you could pass to your server through AJAX.

    JS Docs: https://dev.twitter.com/docs/intents/events

    REST Docs: https://dev.twitter.com/docs/api

    0 讨论(0)
提交回复
热议问题