Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to tweet something directly just with the click of a button without using tweetbox?

I m just looking forward to tweet something directly from a webpage without using the tweet box. Of course, after authentication. All i want is this. If the user is already logged in tweet directly if he clicks on the button. If not, provide an authentication screen and immediately after logging in tweet the text. And no use of tweet box. Any idea abt how this can be done? Thanks.

like image 253
Sri Avatar asked Jan 19 '26 16:01

Sri


1 Answers

I have made a javascript function you can call onClick.. or just call the URL:

function tweet(url, text) {
            url = encodeURIComponent(url);
            text = encodeURIComponent(text);
            window.open("http://twitter.com/intent/tweet?original_referer=" + url + "&text=" + text + "&url=" + url, "_blank");
        }

I have used this on multiple project, easy to use, uses Twitter itself, simple and adds a short url to the message.

I am not 100% sure if this is what you are looking for, but can be handy.

like image 119
Marc Uberstein Avatar answered Jan 21 '26 06:01

Marc Uberstein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!