Skip to content

Instantly share code, notes, and snippets.

@anuraj
Created June 12, 2020 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anuraj/2d594fd819b3536526517ad118d109d9 to your computer and use it in GitHub Desktop.
Save anuraj/2d594fd819b3536526517ad118d109d9 to your computer and use it in GitHub Desktop.
Create and Publish tweet.
//Add reference of Tweetinvi
using Tweetinvi;
using Tweetinvi.Models;
public static void CreateTweet(string text)
{
var credentials = new TwitterCredentials(TwitterConsumerKey,
TwitterConsumerSecret,
TwitterAccessToken,
TwitterAccessTokenSecret);
var client = new TwitterClient(credentials);
var tweet = client.Tweets.PublishTweetAsync(text).Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment