public HttpResponseMessage GetUser(string token) { user usuario = new user(); IAuthenticatedUser usAut = Tweetinvi.User.GetAuthenticatedUser(); usuario.nick = usAut.ScreenName; usuario.usario = usAut.Name; usuario.imagen = usAut.ProfileImageUrl400x400; usuario.followers = usAut.FollowersCount; usuario.follow = usAut.FriendsCount; usuario.descripcion = usAut.Description; var tweets = Timeline.GetUserTimeline(usAut.UserIdentifier); if (tweets != null) { List <tw> timeLineHistoric = new List <tw>(); foreach (var twi in tweets) { tw twiti = new tw(); int i = 0; if (twi.IsRetweet) { twiti.text = twi.RetweetedTweet.FullText; twiti.likes = twi.RetweetedTweet.FavoriteCount; twiti.retwets = twi.RetweetedTweet.RetweetCount; twiti.usario = twi.RetweetedTweet.CreatedBy.Name; twiti.imagen = twi.RetweetedTweet.CreatedBy.ProfileImageUrl400x400; twiti.nick = twi.RetweetedTweet.CreatedBy.UserIdentifier.ScreenName; timeLineHistoric.Add(twiti); } else { twiti.text = twi.FullText; twiti.likes = twi.FavoriteCount; twiti.retwets = twi.RetweetCount; twiti.usario = twi.CreatedBy.Name; twiti.imagen = twi.CreatedBy.ProfileImageUrl400x400; twiti.nick = twi.CreatedBy.UserIdentifier.ScreenName; timeLineHistoric.Add(twiti); } i++; if (i > 100) { break; } } usuario.timeline = timeLineHistoric; } return(Request.CreateResponse(usuario)); }
public HttpResponseMessage tweetsPorTendencia(string tendencia) { List <tw> respuesta = new List <tw>(); var tweets = Search.SearchTweets(tendencia); int i = 0; if (tweets != null) { foreach (var twi in tweets) { tw twiti = new tw(); if (twi.IsRetweet) { twiti.text = twi.RetweetedTweet.FullText; twiti.likes = twi.RetweetedTweet.FavoriteCount; twiti.retwets = twi.RetweetedTweet.RetweetCount; twiti.usario = twi.RetweetedTweet.CreatedBy.Name; twiti.imagen = twi.RetweetedTweet.CreatedBy.ProfileImageUrl400x400; twiti.nick = twi.RetweetedTweet.CreatedBy.UserIdentifier.ScreenName; respuesta.Add(twiti); } else { twiti.text = twi.FullText; twiti.likes = twi.FavoriteCount; twiti.retwets = twi.RetweetCount; twiti.usario = twi.CreatedBy.Name; twiti.imagen = twi.CreatedBy.ProfileImageUrl400x400; twiti.nick = twi.CreatedBy.UserIdentifier.ScreenName; respuesta.Add(twiti); } i++; if (i > 40) { break; } } return(Request.CreateResponse(respuesta)); } else { return(null); } }
assertFalse(tw.isPostOrderTraversal());