private static TinyTwitter CreateTinyTwitter() { var oauth = GetOAuthInfo(); var twitter = new TinyTwitter(oauth); return twitter; }
public void postTweet([FromBody] dynamic info) { var oauth = new OAuthInfo { AccessToken = "859172498277117953-k776EcH3gjeaHZwTth2e7GiIUpxHlqI", AccessSecret = "s9e8dmObtIt9vOOXQ0tqQfEz64ORvcFM4nsvlg5EaR5sA", ConsumerKey = "zNDXWJkUSF5Dkua9TKggKwxzh", ConsumerSecret = "TpQ3wYSEnjLUXogeRHLMphxQHstxcjEexxz2KzaQZtM2ZpCSzy" }; var twitter = new TinyTwitter(oauth); twitter.UpdateStatus((string)(info.tweet)); }
public void Write_tweets_and_read_timeline() { var oauth = GetOAuthInfo(); var twitter = new TinyTwitter(oauth); var status = Guid.NewGuid().ToString(); twitter.UpdateStatus(status); // Wait a little to let twitter update timelines Thread.Sleep(TimeSpan.FromSeconds(3)); var tweets = twitter.GetHomeTimeline(); Assert.AreEqual(status, tweets.First().Text); }
public Twitter(SocialSettings settings) : base(settings) { ApiName = "Twitter"; _consumerKey = (settings as TwitterSettings).ConsumerKey; _consumerSecret = (settings as TwitterSettings).ConsumerSecret; _accessTokenKey = (settings as TwitterSettings).AccessToken; _accessTokenSecret = (settings as TwitterSettings).AccessTokenSecret; apiWrapper = new TinyTwitter( new OAuthInfo { AccessSecret = _accessTokenSecret, AccessToken = _accessTokenKey, ConsumerKey = _consumerKey, ConsumerSecret = _consumerSecret } ); }
static void Main(string[] args) { //OAuthInfo myOAuth = new OAuthInfo(); //myOAuth.ConsumerKey = ""; //myOAuth.ConsumerSecret = ""; //myOAuth.AccessSecret = ""; //myOAuth.AccessToken = ""; //var myOauth = new //TinyTwitter TT = new TinyTwitter(new OAuthInfo()); //IEnumerable<Tweet> mytimneline = TT.GetHomeTimeline(null, 2); var oauth = new OAuthInfo { AccessToken = "21985278-dud1wSertHCQYTUK5ta5AA0ciqWB31ZsT8Dt8DJg", AccessSecret = "yPDp2TTOOhQj6XDxX7P5TxmNtHZcQ6sJumth8DVzRk", ConsumerKey = "tedRo766zL7mr7TKZkOugA", ConsumerSecret = "WREOp5SZ71EtLCt3T4RboUv1IrkUpPkCpcBxkAGk8" }; var twitter = new TinyTwitter(oauth); //// Update status, i.e, post a new tweet //twitter.UpdateStatus("I'm tweeting from C#"); // Get home timeline tweets var tweets = twitter.GetUserTimeline(null, 5); //twitter.UpdateStatus("First tweet from my program"); // twitter.UpdateStatus("First tweet from my program"); foreach (var tweet in tweets) Console.WriteLine("{0}: {1}: {2}", tweet.UserName, tweet.Text, tweet.Id); Console.ReadKey(); }