Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post Images on Twitter using JavaScript

I am trying to make an application which is able to post images on twitter. I need to use javascript for the same. The below code navigates my page to twitter but i dont know how to move ahead. Any help is appreciated.

<a href="https://twitter.com/share" class="twitter-share-button" data-lang="en">Tweet</a>
<script>

!function(d,s,id){
    var js,fjs=d.getElementsByTagName(s)[0];
    if(!d.getElementById(id)){
        js=d.createElement(s);
        js.id=id;
        js.src="//platform.twitter.com/widgets.js";
        fjs.parentNode.insertBefore(js,fjs);
    }
}
(document,"script","twitter-wjs");
</script>

Thank you in advance:)

like image 532
Khush Avatar asked Jun 07 '26 04:06

Khush


1 Answers

You need Twitter API which allows you to post new tweets ( Images, .. ) using current logged in user's account.

like image 152
code2be Avatar answered Jun 10 '26 18:06

code2be



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!