Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello,
I have integrated code to post twit on twitter from my asp.net website using Twitterizer API Library. Please see below code

C#
TwitterStatus.Update(tokens, "Message");


Using this methode i can send only text message But, I want to send text message with small image.

is it possible to send small image with text message using Twitterizer ?

Please help me.

Thanks!
Posted
Updated 26-May-12 22:15pm
v2

1 solution

#region Post Tweets with Image
byte[] photo = File.ReadAllBytes(@"C:\Users\Public\Pictures\Sample Pictures\Koala.jpg");
TwitterResponse response = TwitterStatus.UpdateWithMedia(tokens, "img", photo);
if (response.Result == RequestResult.Success)
{
Response.Write(" Image Post Successfully");
}
#endregion

img is your twit
photo is your uploaded photo
tokens is -- see below

OAuthTokens tokens = new OAuthTokens();
tokens.ConsumerKey = oauth_consumer_key;
tokens.ConsumerSecret = oauth_consumer_secret;
tokens.AccessToken = oauth_token;
tokens.AccessTokenSecret = oauth_token_secret;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900