Callback after sending a message on Twitter

I am sending messgae to twiter at the link: http://twitter.com/intent/tweet?source=webclient&text=Hello

I am wondering if it is possible to redirect to any URL after sending a message? For example, Facebook has a redirect_uri parameter added to the URL. The user is redirected to this URL after the message is posted on the wall.

+6
source share
2 answers

You can use event binding for Web Intents to redirect to the URL after tweets.

window.twttr = (function (d,s,id) { var t, js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js=d.createElement(s); js.id=id; js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); }(document, "script", "twitter-wjs")); twttr.ready(function (twttr) { twttr.events.bind('tweet', function (event) { //redirect to your url } ); }); 

The following links may help:

https://dev.twitter.com/docs/intents/events#events

https://dev.twitter.com/discussions/671

+4
source

According to the documentation , there is no parameter in the tweets setting for the network that allows the user to return to your site after the tweet is posted,

Most of the websites I've seen present a web intent in a popup instead of sending the user away from their site.

+1
source

Source: https://habr.com/ru/post/897826/


All Articles