I am posting messgae to twiter via link: http://twitter.com/intent/tweet?source=webclient&text=Hello
I am interested in if it is possible to be redirected to some url after posting message? For example Facebook has "redirect_uri" parameter added to the URL. User is redirected to this URL after the meesage is posted on the wall.
You can use events binding for Web Intents to redirect to a url after tweeting.
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 } );
});
Following links might help :
https://dev.twitter.com/docs/intents/events#events
https://dev.twitter.com/discussions/671
According to the documentation, the tweet web intent does not have a parameter that allows the user to return to your website after the tweet is posted.
Most websites that I've seen present the web intent in a popup instead of sending the user away from their site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With