It's easy to post Text without image, I found many useful link to post text , but when I searched for how to post Image with Text together on twitter using php code , there was no fair result, now I want to upload image with Text on twitter , does it really possible ? if yes, how to do that? the below code I used to post text :
<?php
$consumerKey="SDJFOISDJF4EIFOISDJFOJFOIJSDFJ";
$consumerSecret="KJSFIOERSDJFLKMEROI3JRISDFJSDF";
$oAuthToken="KSDJFOFJIEIOR5343904830948DKFDSLFJSDLKFJSDLKFJ";
$oAuthSecret="ASJDFOIRU3RUIODJFKLSDFOIEJRTOJOIDFJOIEJTROIEJOIDJF";
include ("OAuth.php");
include ("twitteroauth.php");
$twitter=new TwitterOAuth($consumerKey,$consumerSecret,$oAuthToken,$oAuthSecret);
if($_GET['msg']!="")
{
if(isset($_GET['msg']))
{
$twittMsg=$_GET['msg'];
$twitter->post('statuses/update',array('status'=>$twittMsg));
print(json_encode("one"));
}else
{
print(json_encode("two"));
}
}
else
{
print(json_encode("Three"));
}
THANKS for any help guys please your comment ...
I think you can try this, Download Twitter Api for php & created one function.
}
Please refer this repo https://github.com/themattharris/tmhOAuth
You can try twitter async library
See this repository Twitter Async
Just test this CODE snippet using 'tmhOAuth library for PHP'.
In the last line code:
Alternatively, Refer: http://www.stirring-interactive.com/blog/tweet-images-using-twitter-api/
If you use the sdk tmhOAuth, you can do it like that!
$image can be an image from your serveur or a brut image from an url. ($image = file_get_content(url of the image)