示例#1
0
            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);
        }
示例#3
0
 public override void PublishMessage(string message)
 {
     apiWrapper.UpdateStatus(message);
 }