I want to share my app images in Twitter. I want to tweet picture with text using Javascript and php and Twitter Api's with callback functions. How can i do this?
I have tried
<script type="text/javascript" src="jquery.twitterbutton.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#twitterbutton-example').twitterbutton({
user: 'POSimplicity',
title: ' powered by POSimplicity',
count_url: false,
user_description: 'user description',
url: 'http://www.abc.in/index.php',
ontweet: function (response) {
var id = $("p").html();
$.ajax({
url: 'add_customer.php',
data: 'twitpoints=' + '<?php echo $res['
0 ']['
regpoints ']; ?>' + '&total_points=' + '30' + '&customer_id=' + id,
dataType: 'html',
success: function (res) {
alert(res);
}
});
},
lang: 'en'
});
});
</script>
In this i am able to tweet URL but not images.
Tap the camera icon to add a new photo or video to your Tweet. Tap the photo icon to attach an existing photo, video, or GIF. Once you have 2 or more photos selected, you can tap and hold a photo to drag and reorder before Tweeting.
In the Twitter app, tap the compose tweet button to create a new tweet. Under the box where you can compose your message, you will see quick selection options for adding a photo or video. Recently-taken photos in your camera's gallery appears as thumbnails, which you can tap to quickly add that photo to your tweet.
You should try this twitter API to upload images with tweet : https://dev.twitter.com/docs/api/1/post/statuses/update_with_media
updated link: https://dev.twitter.com/rest/reference/post/statuses/update
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