Esempio n. 1
0
 public JsonResult AddTweet(TweetModel tweet)
 {
     Model.Tweet newTweet = new Model.Tweet();
     newTweet.message  = tweet.Message;
     newTweet.tweet_id = tweet.Tweet_id;
     newTweet.user_id  = User.Identity.Name;
     person.AddOrUpdateTweet(newTweet);
     return(Json("Ok"));
 }
Esempio n. 2
0
        public string Tweet(Model.Tweet tweet)
        {
            var user     = GetAuthenticatedUser(tweet.Token);
            var response = user.PublishTweet(tweet.Message);

            if (response == null)
            {
                var twitterException = ExceptionHandler.GetLastException();
                var status           = GetExceptionInfos(twitterException);
                return(status);
            }
            return(response.IdStr);
        }